{include file="public/head"/}
<script language="javascript">
	$(document).ready(function () {
		var lang = $('#lang').text();
        var language = '';
        if (lang == 'pt') {
            language = 'pt-BR';
        } else if (lang == 'en') {
            language = 'en';
        } else {
            language = 'zh-CN';
        }
        // datatimepicker 设置
        $('.form_datetime').datetimepicker({
            language: language, // en ,zh-CN, pt-BR
            format: 'yyyy-mm-dd',
            minView: 'month',
            weekStart: 0, //一周从哪一天开始
            todayBtn: 1, //底部会出现一个今天
            autoclose: true,//自动关闭
            todayHighlight: 1,//高亮今天日期
            startView: 2,//显示的视图
            forceParse: 1,//当选择器关闭的时候，是否强制解析输入框中的值
            showMeridian: 1
        });


		$("#pro_history").hide();
		$("#discount_type").click(function(){
			$(this).find("input[name='discount_type']").each(function(){
				if($(this).prop("checked")){
					if($(this).val()==1){
						$("#discount_mark").text("%")
					}else{
						$("#discount_mark").text("BRL")
					}
				}
			})
		});
		$("#slider-priority").slider({
			range: "max",
			min:1,
			max:6,
			value:3,
			slide:function(event,ui){
				$("#priority-num").text(ui.value);
			}
		})
	});
	
</script>
<div id='main'>

<div class="container-fluid">
  <div class="row clearfix">
    <div class="col-md-12 column">
      <div class="alert alert-dismissable alert-info" id="alertMain">
        <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
      	<p></p>
      </div>
    </div>
   </div>


  <div class="ntDesktop">
  	<div class="ntDesktop-head">{$title|default=''}</div>
  	<input type="hidden" id="requestType" value="{$requestType|default=''}">
  	<input type="hidden" id="create_id" value="{$create_id|default=''}">
  	<input type="hidden" id="create_name" value="{$create_name|default=''}">
  	<input type="hidden" id="edit_id" value="{$edit_id|default=''}">
  	<input type="hidden" id="tab" value="{$tab|default='order'}">
  	<input type="hidden" id="admin_id" value="{$Think.session.admin.id|default=''}">

  	<!-- nav -->
	<div class="row" style="padding-top:0px" id="headnav">
		<div class="col-md-8" >
			<ul class="nav nav-tabs">
				<li :class="{'active':tabType == 'order'}">
					<a href="#order" data-toggle="tab">订单</a>
				</li>
				<li :class="{'active':tabType == 'products'}">
					<a href="#products" data-toggle="tab">
						产品 <span class="label label-info" v-if="orderList.length != undefined && orderList.length > 0">{{orderList.length}}</span>
					</a>
				</li>
				<li :class="{'active':tabType == 'cost'}">
					<a href="#cost" data-toggle="tab">
						费用 <span class="label label-info" v-if="costData.length != undefined && costData.length > 0">{{costData.length}}</span>
					</a>
				</li>
				<li :class="{'active':tabType == 'pay'}" @click="setPaymentPrice()">
					<a href="#pay" data-toggle="tab">付款安排</a>
				</li>
				<template v-if="viewType!='add'">
					<li :class="{'active':tabType == 'paid'}" @click="setPayreyHeadTable()">
						<a href="#paid" data-toggle="tab">付款登记</a>
					</li>
					<li :class="{'active':tabType=='delivery'}" v-if="data.underwrite == 1">
						<a href="#delivery" data-toggle="tab" >送货单</a>
					</li>
					<li :class="{'active':tabType == 'log'}">
						<a href="#log" data-toggle="tab">订单记录</a>
					</li>
				</template>
			</ul>
		</div>
		<div class="col-md-4 text-right">
			<a :href="'/admin/sale/list'" class="btn btn-default" style="width:10em">
				<span class="fa fa-arrow-left"> 返回列表</span>
			</a>
            <button class="btn btn-primary" style="padding-left:2em;padding-right:2em;" @click="saleOrderSave(true)"  :disabled="isdisabled"> 
            	<span class="glyphicon glyphicon-floppy-saved"></span> {:strtoupper(lang("return_to_list_after_saving"))} 
            </button>
            <button href="javascript:;" class="btn btn-primary" style="padding-left:2em;padding-right:2em;" @click="saleOrderSave(false)"  :disabled="isdisabled"> 
            	<span class="glyphicon glyphicon-floppy-save"></span> {:strtoupper(lang("continue_adding_new_content_after_saving"))}
            </button>
		</div>
	</div>


	<div class="tab-content" id="indexcontent">
		<!-- 订单 -->
		<div class="tab-pane active" id="order">
			<div class="row" style="padding: 1em">
				<div class="col-md-8">
					<div class="row" style="padding:0.4em">
						<div class="col-md-1">订单号</div>
						<div class="col-md-2">{{  data.saleOrderNo == '-' ? data.saleOrderNo : formatUnit(data.saleOrderNo,'id') }}</div>
						<div class="col-md-9 text-right">
							<button class="btn btn-default" @click="setSaleStatus('underwrite')">
								<input name="underwrite" type="checkbox" v-model="data.underwrite"> 包销订单
							</button>
							<button class="btn btn-default"  @click="setSaleStatus('pledge')">
								<input name="pledge" type="checkbox" v-model="data.pledge"> 需要定金
							</button>
							<button class="btn btn-default "  @click="setSaleStatus('makefirst')">
								<input name="makefirst" type="checkbox" v-model="data.makefirst"> 先配货后结算
							</button>
							<button class="btn btn-primary">
								<span class="fa fa-comment-dots" data-toggle="modal" data-target="#remark_Modal" @click="setSaleOrderRemarks()"> 订单备注</span>
							</button>
						</div>
					</div>
					<div class="row" style="padding:0.4em">
						<div class="col-md-1">客户<span class="required"></span></div>
						<div class="col-md-11">
							<div class="input-group">
								<input type="text" class="form-control" placeholder="查找内容公司名称，ID，营业税号CNPJ" name="companyName" v-model='data.companySearchText'>
								<div class="input-group-btn">
									<button class="btn btn-default" @click="companySearch()">
										<span class="fa fa-search"> 查找</span>
									</button>
								</div>
							</div>
						</div>
					</div>
					<div class="row" style="padding:0.4em">
						<div class="col-md-offset-1 col-md-11">
							<select id="" class="form-control" v-model="data.companyId" @change="getCompanyBranch(data.companyId)">
								<option value="0" v-if='company.length > 0'>请选择</option>
								<option value="0" v-else>暂无内容</option>
								<option :value="companyItem.id" v-for="(companyItem,companyIndex) in company">{{companyItem.name}}</option>
							</select>
						</div>
					</div>
					<div class="row" style="padding:0.4em">
						<div class="col-md-1">分公司</div>
						<div class="col-md-11">
							<!-- <select name="" id="" class="form-control" v-model="data.branchCompanyId" @change="getCompanyInfo(data.branchCompanyId)"> -->
							<select name="" id="" class="form-control" v-model="data.branchCompanyId">
								<option value="0">请选择分公司</option>
								<option :value="branchCompanyItem.id" v-for="(branchCompanyItem,branchCompanyIndex) in branchCompany">{{branchCompanyItem.name}}</option>
							</select>
						</div>
					</div>
					<div class="row" style="padding:0.4em">
						<div class="col-md-1">业务员<span class="required"></span></div>
						<div class="col-md-5">
							<select name="" id="" class="form-control" v-model="data.saler_id">
								<option value="0">请选择业务员</option>
								<option :value="salerItem.id" v-for="(salerItem,salerIndex) in saler">{{salerItem.nickname}}</option>
							</select>
						</div>
						<div class="col-md-1">优先级<span class="required"></span></div>
						<div class="col-md-5">
							<div class="row">
								<div class="col-md-2"><span class="label label-primary" id="priority-num" style="padding:0.4rem 1.2rem">{{data.priority}}</span></div>
								<div class="col-md-10" style="padding-top:0.75rem"><div id="slider-priority" @click="setPriority(data.priority)"></div></div>
							</div>
						</div>
					</div>

					<div class="row" style="padding:0.4em">
						<div class="col-md-1">送货方式<span class="required"></span></div>
						<div class="col-md-5">
                            <select  class="form-control" name="deliveryType" id="deliveryType" v-model="data.saleDeliveryTypeId" v-cloak @change="selectDeliveryType(data.saleDeliveryTypeId)">>
								<option value="0">请选择送货方式</option>
								<option  v-for="(deliveryType,deliveryTypeIndex) in saleDeliveryTypeList" :value="deliveryType.id">{{deliveryType.content}}</option>
							</select>
						</div>
						<template v-if="data.saleDeliveryTypeId == 4">
							<div class="col-md-1">指定物流<span class="required"></span></div>
							<div class="col-md-5">
								<select name="company" id="company" class="form-control" v-model="data.logisticsCompanyId">
									<option value="0">请选择物流</option>
									<option :value="logisticsCompanyItem.id" v-for="(logisticsCompanyItem,logisticsCompanyIndex) in logisticsCompany" >{{logisticsCompanyItem.name}}</option>
								</select>
							</div>
						</template>
					</div>
				</div>
				<div class="col-md-4">
					<div class="panel panel-info">
						<div class="panel-heading">公司信息</div>
						<div class="panel-body">
							<p>{{companyInfo.id ? companyInfo.id : ''}}  <strong>{{companyInfo.name ? ' / ' + companyInfo.name : ''}}</strong></p>
							<address>
								{{companyInfo.addr ? companyInfo.addr : ''}}
							</address>
							<p>{{companyInfo.credit ?'积分：' + companyInfo.credit : ''}}  {{companyInfo.level ? ' / 等级：' + companyInfo.level : ''}}</p>
						</div>
					</div>
				</div>
			</div>
		</div>

		<!-- 产品 -->
		<div class="tab-pane" id="products">
			<div class="row" style="padding: 1em">
				<div class="col-md-2">
					<div class="panel panel-default" style="margin-bottom:0">
						<div class="panel-heading">统计</div>
						<div class="panel-body">
							<table class="table" style="margin-bottom:0">
								<tr>
									<td width="30%">箱数：</td>
									<td align="right">{{formatUnit(proCount.package_sum,'CTN')}}<small class="unit">CTN</small></td>
								</tr>
								<tr>
									<td>体积：</td>
									<td align="right">{{formatUnit(proCount.m3,'M3')}}<small class="unit">CBM</small></td>
								</tr>
								<tr>
									<td>重量：</td>
									<td align="right">{{formatUnit(proCount.kgs,'KGS')}}<small class="unit">KGS</small></td>
								</tr>
								<tr>
									<td>金额：</td>
									<td align="right">{{formatUnit(proCount.price,'BRL')}}<small class="unit">BRL</small></td>
								</tr>
							</table>
						</div>
					</div>
				</div>
				<div class="col-md-6">
					<div class="panel panel-default" style="margin-bottom:0">
						<div class="panel-heading">产品</div>
						<div class="panel-body">
							<table class="table" style="margin-bottom:0">
								<tr>
									<td>
										<div class="input-group">
                                            <div class="input-group-btn"> <!--产品分类-->
                                                <select  class="form-control" name="" ref="procat" id="procat" style="width: 150px;" @change="searchPro()" v-model="proCateId">
                                                    <option value="0" selected >{:strtoupper(lang("please_select_a_product_category"))}</option>
                                                    <option :value="proCateItem.id" v-for="(proCateItem,proCateIndex) in proCate">
                                                        <template v-for="(level,proCateIndex) in proCateItem.level">
                                                            &nbsp;&nbsp;&nbsp;&nbsp;
                                                        </template>
                                                        {{proCateItem.content}}
                                                    </option>
                                                </select>
                                            </div>

											<input type="text" class="form-control" id="searchText" placeholder="输入产品角色ID，MODEL,产品名称" v-model="searchText">
											<div class="input-group-btn">
												<button type="button" class="btn btn-default" @click="searchPro()">
													<span class="glyphicon glyphicon-search"></span> 查找
												</button>
											</div>
										</div>
									</td>
								</tr>
								<tr>
									<td>
										<select class="form-control" id="select_prochar_list" v-model="proInfoKey" @change="getSaleRecording()">
											<option value="-1">选择产品列表</option>
											<!-- <option>角色ID / 品牌 / 角色MODEL / 产品名称 / 特征1  / 特征2  / 特征3 </option> -->
											<option :value="proInfoIndex" v-for="(proInfoItem,proInfoIndex) in proInfo" > {{(proInfoItem.prochar_id ? proInfoItem.prochar_id : '') + (proInfoItem.brand_name ? ' / '+proInfoItem.brand_name :'') + (proInfoItem.model ? ' / '+proInfoItem.model : '') + (proInfoItem.pro_name ? ' / '+proInfoItem.pro_name : '') + (proInfoItem.feature ? ' / '+proInfoItem.feature :'')}}</option>
										</select>
									</td>
								</tr>
								<tr>
									<td>
										<div class="col-md-5">
											<div class="input-group" >
												<input type="number" class="form-control text-right" id="orderNum" placeholder="订购数量" @input="setProMax()">
												<span class="input-group-addon">PCS</span>
											</div>
										</div>
										<div class="col-md-5">
											<div class="input-group" >
												<input type="number" class="form-control text-right" id="orderPrice" placeholder="单价" @input="proMaxPrice()">
												<span class="input-group-addon">BRL</span>
											</div>
										</div>
										<button type="button" class="btn btn-primary col-md-2" @click="selectProInfoKey()">
											<span class="glyphicon glyphicon-plus"></span> 确认
										</button>
									</td>
								</tr>
							</table>
						</div>
					</div>
				</div>
				<div class="col-md-4">
					<div class="panel panel-default" style="margin-bottom:0">
						<div class="panel-heading">销售记录</div>
						<div class="panel-body">
							<div id="pro_nothing" align="center">
								<h3 style="line-height: 5em">没有内容</h3>
							</div>
							<div id="pro_history">
								<table class="table ntTable" style="margin-bottom:0">
									<thead>
										<tr>
											<th>订单号</th>
											<th>数量</th>
											<th>单价</th>
											<th>日期</th>
										</tr>
									</thead>
									<tbody>
										<tr v-for="(saleRecordingItem,saleRecordingIndex) in saleRecording">
											<td>{{ formatUnit(saleRecordingItem.sale_id,'id') }}</td>
											<td align="right">{{saleRecordingItem.qty}} <small class="unit">PCS</small></td>
											<td align="right">{{saleRecordingItem.price}} <small class="unit">BRL</small></td>
											<td align="right">{{saleRecordingItem.finish_at}}</td>
										</tr>
									</tbody>
								</table>
							</div>
						</div>
					</div>
				</div>
			</div>

			<div class="row">
				<div class="col-md-12">
					<table class="table table-striped table-hover iTable ntTable">
						<thead>
							<tr>
								<th>No.</th>
								<th>产品</th>
								<th>箱规</th>
								<th>库存</th>
								<th>数量</th>
								<th>单价</th>
								<th>小计</th>
								<th>折扣</th>
								<th>提成</th>
								<th>备注</th>
								<th>操作</th>
							</tr>
						</thead>
						<template v-if="orderList.length != undefined && orderList.length > 0">
							<tbody id='proTable'>
								<tr v-for="(orderListItem,orderListIndex) in orderList">
									<td align="center"></td>
									<td>
										<div class="pro">
											<div class="pro-icon"><img :src="orderListItem.img_url" border="0" width="48px" height="48px" alt="ICON"></div>
											<div class="pro-name">
												<small>{{orderListItem.prochar_id + (orderListItem.brand_name ? " / " + orderListItem.brand_name : '' )  + (orderListItem.model ? " / " + orderListItem.model : '' ) }} </small> <br />{{( orderListItem.pro_name ? orderListItem.pro_name : '' ) }}
											</div>
										</div>
									</td>
									<td align="right">
										{{orderListItem.prochar_qty}} <small class="unit">PCS/CTN</small><br>
										{{orderListItem.ctn_size}} <small class="unit">CM</small>
									</td>
									<td align="right">
										<span class="red" v-if="orderListItem.status.status <= 2 ">{{ formatUnit(orderListItem.status.status,'PCS')}}</span> <small class="unit" v-if="orderListItem.status <= 2 ">PCS</small></span>
										<span class="red" v-if="orderListItem.status.status == 9">少量</span>
										<span class="blue" v-if="orderListItem.status.status == 8">大量</span>
										<span class="green" v-if="orderListItem.status.status == 7">充足</span>
										<br>
										<span class="label label-info" v-if="orderListItem.storeType == 'outGet'">外调</span>
										<span class="label label-danger" v-if="orderListItem.storeType == 'futures'">期货</span>
									</td>

									<td align="right">
										<input type="number" class="form-control text-right" style="width:7em" :value="orderListItem.orderNum" @input="changeOrderNum('orderList',orderListIndex,$event,'orderNum')">
									</td>
									<td align="right">
										<input type="number" class="form-control text-right" style="width:7em" :value="orderListItem.orderPrice" @input="changeOrderNum('orderList',orderListIndex,$event,'orderPrice')">
									</td>
									<td align="right">
										{{ formatUnit(orderListItem.Subtotal,'BRL') }}<small class="unit">BRL</small><br>
										<span class="green">{{ formatUnit(orderListItem.orderListDiscountPriceSum,'BRL') }}</span> <small class="unit">BRL</small>
									</td>
									<td align="right">
										{{ formatUnit(orderListItem.orderListDiscount,'%') }}<small class="unit">{{orderListItem.discountType ? orderListItem.discountType : '%'}}</small><br>
										<!-- <span class="green">{{orderListItem.orderListDiscountPriceSum}}</span> <small class="unit">BRL</small> -->
									</td>
									<td align="right">{{ formatUnit(orderListItem.orderListCommission,'%') }}<small class="unit">%</small></td>
									<td>&nbsp;</td>
									<td class="text-right">
										<button class="btn btn-sm btn-primary" data-toggle="modal" data-target="#pro_remark_Modal" @click="proRemarks(orderListIndex)" v-if="orderListItem.storeType != 'futures'">加工/备注</button>
										<button class="btn btn-sm btn-primary" data-toggle="modal" data-target="#pro_discount_Modal" @click="proDiscount(orderListIndex)">折扣</button>
										<button class="btn btn-sm btn-primary" data-toggle="modal" data-target="#pro_commission_Modal" @click="proCommission(orderListIndex)">提成</button>
										<button class="btn btn-sm btn-default" @click="modalEditAndDel(orderListIndex,'del','orderList')">删除</button>
									</td>
								</tr>
							</tbody>
						</template>
						<template v-else>
							<tr style="text-align: center;">
	                            <td colspan="11" style="font-size: 2em;font-weight: bold;padding: 1em 10em;"> {:lang('no_data')} </td>
	                        </tr>
						</template>
					</table>
				</div>
			</div>
		</div>

		<!-- 费用 -->
		<div class="tab-pane" id="cost">
			<div class="row" style="padding: 1em">
				<div class="col-md-3">
					<div class="panel panel-info">
						<div class="panel-heading">账单</div>
						<div class="panel-body">
							<table class="table ntTable">
								<tbody>
									<tr>
										<td>货款</td>
										<td align="right"> {{formatUnit(billDate.price,'BRL')}} <small class="unit">BRL</small></td>
									</tr>
									<tr>
										<td>折扣</td>
										<td align="right"> <span class="red">- {{formatUnit(billDate.discountPrice,'BRL')}}</span> <small class="unit">BRL</small></td>
									</tr>
									<tr>
										<td>提成</td>
										<td align="right"> <span class="green">{{formatUnit(billDate.commissionPrice,'BRL')}}</span> <small class="unit">BRL</small></td>
									</tr>
									<tr>
										<td>费用</td>
										<td align="right"> <span class="blue">{{formatUnit(billDate.costPrice,'BRL')}}</span> <small class="unit">BRL</small></td>
									</tr>
									<tr>
										<td>应付</td>
										<td align="right"> {{formatUnit(billDate.price - billDate.discountPrice+billDate.costPrice,'BRL')}}<small class="unit">BRL</small></td>
									</tr>
								</tbody>
							</table>
						</div>
					</div>
				</div>
				<div class="col-md-9">
					<div class="panel panel-default">
						<div class="panel-body">
							<div class="row" style="padding:0.5em">
								<div class="col-md-2">费用类型<span class="required"></span></div>
								<div class="col-md-4">
									<select name="" id="saleCostTypeIndex" class="form-control" >
										<option value="-1">请选择费用类型</option>
										<option :value="saleCostTypeIndex" v-for="(saleCostTypeItem,saleCostTypeIndex) in saleCostType">{{saleCostTypeItem.name + saleCostTypeItem.options}}</option>
									</select>
								</div>
								<div class="col-md-1">金额<span class="required"></span></div>
								<div class="col-md-3">
									<div class="input-group">
										<input type="number" class="form-control text-right" id="costPrice" value="0">
										<input type="hidden" class="form-control text-right" id="costPriceKey" value="-1">
										<span class="input-group-addon">BRL</span>
									</div>
								</div>
								<button class="btn btn-primary col-md-2" @click="setCost()">
									<span class="fa fa-plus"> 确认</span>
								</button>
							</div>
							<div class="row" style="padding:0.5em">
								<div class="col-md-2">备注</div>
								<div class="col-md-8"><input type="text" class="form-control" id="costRemarks"></div>
							</div>
						</div>
					</div>
					<table class="table ntTable">
						<thead>
							<tr>
								<th>No.</th>
								<th>类型</th>
								<th>备注</th>
								<th>金额</th>
								<th>编辑</th>
								<th>操作</th>
							</tr>
						</thead>
						<tbody>
							<template v-if="costData != undefined && costData.length > 0">
							<tr v-for="(costDataItem,costDataIndex) in costData">
								<td align="center">{{costDataItem.viewid}}</td>
								<td>{{costDataItem.content + costDataItem.options}}</td>
								<td>{{costDataItem.costRemarks}}</td>
								<td align="right"><span class="blue">{{formatUnit(costDataItem.costPrice,'BRL')}}</span> <small class="unit">BRL</small></td>
								<td> {{costDataItem.create_name}} / {{costDataItem.create_at}}</td>
								<td align="right">
									<button class="btn btn-sm btn-primary" @click="modalEditAndDel(costDataIndex,'edit','costData')">编辑</button>
									<button class="btn btn-sm btn-default" @click="modalEditAndDel(costDataIndex,'del','costData')">删除</button>
									<button class="btn btn-sm btn-danger option-clear" @click="modalEditAndDel(costDataIndex,'clear','costData')" v-show="admin_id == 1 && costDataItem.del_at > 0">清除</button>
								</td>
							</tr>
							</template>
							<template v-else>
								<tr style="text-align: center;">
	                                <td colspan="6" class="no_date" style="line-height: 12rem">{:lang('no_data')} </td>
	                            </tr>
							</template>
						</tbody>
					</table>
				</div>
			</div>
		</div>

		<!-- 付款安排 -->
		<div class="tab-pane" id="pay">
			<div class="row" style="padding: 1em">
				<div class="col-md-3">
					<div class="panel panel-info">
						<div class="panel-heading">账单</div>
						<div class="panel-body">
							<table class="table ntTable">
								<tbody>
									<tr>
										<td>货款</td>
										<td align="right"> {{formatUnit(billDate.price,'BRL')}} <small class="unit">BRL</small></td>
									</tr>
									<tr>
										<td>折扣</td>
										<td align="right"> <span class="red">- {{formatUnit(billDate.discountPrice,'BRL')}}</span> <small class="unit">BRL</small></td>
									</tr>
									<tr>
										<td>提成</td>
										<td align="right"> <span class="green">{{formatUnit(billDate.commissionPrice,'BRL')}}</span> <small class="unit">BRL</small></td>
									</tr>
									<tr>
										<td>费用</td>
										<td align="right"> <span class="blue">+ {{formatUnit(billDate.costPrice,'BRL')}}</span> <small class="unit">BRL</small></td>
									</tr>
									<tr>
										<td>应付</td>
										<td align="right"> {{formatUnit((billDate.price - billDate.discountPrice+billDate.costPrice),'BRL')}}<small class="unit">BRL</small></td>
									</tr>

									<tr>
										<td>安排 <span class="label label-primary">合计</span></td>
										<td align="right"> {{formatUnit(billDate.paymentPrice,'BRL')}} <small class="unit">BRL</small></td>
									</tr>
								</tbody>
							</table>
						</div>
					</div>
				</div>
				<div class="col-md-9">
					<div class="panel panel-default">
						<div class="panel-heading">付款安排</div>
						<div class="panel-body">
							<div class="row" style="padding:0.5em">
								<!-- 页面固定数据 -->
								<div class="col-md-12">
									<button class="btn btn-sm btn-default disabled">快捷输入</button>
									<button class="btn btn-sm btn-info" v-for="(quickInputIten,quickInputIndex) in quickInput" @click="clickSetPayment(quickInputIndex)" style="margin-right: 0.4%">
										{{quickInputIten.name}}
										<template v-for="(dataItem,dataIndex) in quickInputIten.data"> 
											<template v-if="dataIndex == 0"> ( </template>
											<template v-if="dataIndex != 0"> + </template>
											{{dataItem.day + 'D' + dataItem.percentage +'%'}}
											<template v-if="dataIndex == quickInputIten.data.length-1"> ) </template>
										</template>
									</button>
									<!-- <button class="btn btn-sm btn-info">现金（D30%+30D70%）</button>
									<button class="btn btn-sm btn-info">支票（D30%+30D30%+30D40%)</button>
									<button class="btn btn-sm btn-info">银行单（30D30%+30D30%+30D40%)</button>
									<button class="btn btn-sm btn-info">期账（30D100%）</button> -->
								</div>
							</div>
							<div class="row receivingAccountItem" style="padding:0.5em;" >
								<div class="col-md-2" style="line-height: 3rem">
									指定收款账号<span class="required"></span>
								</div>
								<div class="col-md-6">
									<select name="" id="" class="form-control" v-model="data.receivingAccounId">
										<option value="0">请选择收款账号</option>
										<option :value="receivingAccountItem.id" v-for="(receivingAccountItem,receivingAccountIndex) in receivingAccount">{{receivingAccountItem.accoun}}</option>
									</select>
								</div>
								<div class="col-md-2" style="line-height: 3rem">
									指定发票类型<span class="required"></span>
								</div>
								<div class="col-md-2">
									<select name="" id="invoiceTypeId" class="form-control" v-model="data.invoiceTypeId" >
										<option value="0">不开发票</option>
										<option :value="getInvoiceTypeListItem.id" v-for="(getInvoiceTypeListItem,getInvoiceTypeListIndex) in getInvoiceTypeList">{{getInvoiceTypeListItem.code}}</option>
									</select>
								</div>
							</div>
							<div class="row" style="padding:0.5em">
								<div class="col-md-3">
									<select name="" class="form-control" id="salePayType" @change="isHideReceivingAccounId()">
										<option value="-1">请选择付款方式</option>
										<option :value="salePayTypeIndex" v-for="(salePayTypeItem,salePayTypeIndex) in salePayType" v-if="salePayTypeItem.fail == 0 || salePayTypeItem.fail < salePayTypeItem.limit">{{salePayTypeItem.content}}</option>
									</select>
								</div>
								<div class="col-md-1">
									<input type="number" class="form-control text-right" name="days" min="0" value="0" id="paymentPayDay" @input="payDayCalculate()">
								</div>

								<div class="col-md-2">
									<div class="input-group date form_datetime">
                                    	<!-- <input class="form-control text-center" type="text"  id="paydate"  v-model="dayTime" readonly> -->
                                    	<input class="form-control text-center" type="text"  id="paydate"  :value="dayTime" >
                                    	<span class="input-group-addon"><span class="glyphicon glyphicon-calendar" style="margin:0"></span></span>
									</div>
									<input type="hidden" id="dayTime_" :value="dayTime"/>
								</div>

								<div class="col-md-2">
									<div class="input-group">
										<input type="number" class="form-control text-right" name="percent" value="0" id="paymentPercentage" @input="paymentCalculation('%')" >
										<span class="input-group-addon"><small>%</small></span>
									</div>
								</div>
								<div class="col-md-2">
									<div class="input-group">
										<input type="number" class="form-control text-right" id="paymentAmount" @input="paymentCalculation('BRL')" >
										<span class="input-group-addon">BRL</span>
									</div>
								</div>
								<button class="btn btn-primary col-md-2" @click="setPayment()">
									<span class="fa fa-save"> 保存</span>
								</button>
								<input type="hidden" id="paymentAmountKey" value="-1">
							</div>
							<table class="table ntTable">
								<thead>
									<tr>
										<th>No.</th>
										<th>支付方式</th>
										<th>日期{{saleList.create_time}}</th>
										<th>金额</th>
										<th>百份比</th>
										<th>编辑</th>
										<th>操作</th>
									</tr>
								</thead>
								<tbody>
									<template v-if="paymentList != undefined && paymentList.length > 0">
										<tr v-for="(paymentListItem,paymentListIndex) in paymentList">
											<td align="center">{{paymentListIndex+1 }}</td>
											<td>{{paymentListItem.content}}</td>
											<td>{{paymentListItem.paymentDay}}<br><span class="green" v-if="daysBetween(saleList.create_time,paymentListItem.paymentDay) > 0 ">+ {{ daysBetween(saleList.create_time,paymentListItem.paymentDay)}}D</span></td>
											<td align="right"> {{formatUnit(paymentListItem.paymentAmount,"BRL")}} <small class="unit">BRL</small></td>
											<td align="right"> {{formatUnit( paymentListItem.paymentAmount/(billDate.price - billDate.discountPrice + billDate.costPrice)*100,'%')}} <small class="unit">%</small></td>
											<td> {{paymentListItem.create_name}} <br> <small>{{paymentListItem.create_at}}</small></td>
											<td align="right">
												<button class="btn btn-sm btn-primary" @click="modalEditAndDel(paymentListIndex,'edit','paymentList')" v-show="paymentListItem.haspayery == 0 || viewType == 'add'">编辑</button>
												<button class="btn btn-sm btn-default" @click="modalEditAndDel(paymentListIndex,'del','paymentList')" v-show="paymentListItem.haspayery == 0 || viewType == 'add'">删除</button>
												<button class="btn btn-sm btn-default" data-toggle="modal" data-target="#payment_remark_Modal" @click="jumpPaymentRemarksData(paymentListIndex)">备注</button>
											</td>
										</tr>	
									</template>
									<template v-else>
										<tr style="text-align: center;">
			                                <td colspan="7" class="no_date" style="line-height: 12rem">{:lang('no_data')} </td>
			                            </tr>
									</template>
								</tbody>
							</table>
						</div>
					</div>
				</div>
			</div>
		</div>

		<!-- 付款登记 -->
		<div class="tab-pane" id="paid">
			<div class="row" style="padding: 1em">
				<div class="col-md-3">
					<div class="panel panel-info">
						<div class="panel-heading">账单</div>
						<div class="panel-body">
							<table class="table ntTable">
								<tbody>
									<tr>
										<td>货款</td>
										<td align="right"> {{formatUnit(billDate.price,'BRL')}} <small class="unit">BRL</small></td>
									</tr>
									<tr>
										<td>折扣</td>
										<td align="right"> <span class="red">- {{formatUnit(billDate.discountPrice,'BRL')}}</span> <small class="unit">BRL</small></td>
									</tr>
									<tr>
										<td>提成</td>
										<td align="right"> <span class="green">{{formatUnit(billDate.commissionPrice,'BRL')}}</span> <small class="unit">BRL</small></td>
									</tr>
									<tr>
										<td>费用</td>
										<td align="right"> <span class="blue">+ {{formatUnit(billDate.costPrice,'BRL')}}</span> <small class="unit">BRL</small></td>
									</tr>
									<tr>
										<td>应付</td>
										<td align="right"> {{formatUnit((billDate.price - billDate.discountPrice + billDate.costPrice),'BRL')}}<small class="unit">BRL</small></td>
									</tr>

									<tr>
										<!-- 
										<td align="right"> {{formatUnit(billDate.payregPaid,'BRL')}} <small class="unit">BRL</small></td> -->
										<td>已付 <span class="label label-primary">已确认</span></td>
										<td align="right">
											<span class="green">{{billDate.payregPaid/(billDate.price - billDate.discountPrice + billDate.costPrice)*100}}</span> <small class="unit">%</small>
											{{formatUnit(billDate.payregPaid,'BRL')}} <small class="unit">BRL</small>
										</td>
										
									</tr>
									<tr>
										<td>未付</td>
										<td align="right"> {{formatUnit(billDate.overdraft,'BRL')}} <small class="unit">BRL</small></td>
									</tr>
								</tbody>
							</table>
						</div>
					</div>
				</div>
				<div class="col-md-9">
					<div class="panel panel-default">
						<div class="panel-heading">付款安排</div>
						<div class="panel-body">
							<table class="table ntTable">
								<thead>
									<tr>
										<th>No.</th>
										<th>付款方式</th>
										<th>&nbsp;</th>
										<th>付款日期</th>
										<th>金额</th>
										<th>编辑</th>
										<th>操作</th>
									</tr>
								</thead>
								<tbody>
									<tr v-for="(salePayregItem,salePayregIndex) in salePayreg" >
										<td align="center">{{salePayregIndex+1}}</td>
										<td>{{salePayregItem.content}}</td>
										<td><!-- <button class="btn btn-sm btn-warning" data-toggle="modal" data-target="#pay_info_Modal">详情</button> --></td>
										<td>{{salePayregItem.paymentDay}}<br><span class="green" v-if="daysBetween(saleList.create_time,salePayregItem.paymentDay) > 0">+ {{daysBetween(saleList.create_time,salePayregItem.paymentDay)}}D</span></td>
										<td  align="right">
											{{formatUnit(salePayregItem.paymentAmount,'BRL')}} <small class="unit">BRL</small><br>
											<span class="green">{{Math.round( (salePayregItem.paymentAmount/(billDate.price - billDate.discountPrice + billDate.costPrice))*10000)/100}}</span> <small class="unit">%</small>
										</td>
										<td> {{salePayregItem.create_name}} <br> <small> {{salePayregItem.create_at}}</small></td>

										<td v-if="salePayregItem.paytype_id == 6 || salePayregItem.paytype_id == 7"></td>
										<td align="right" v-else>
											<!-- <button class="btn btn-sm btn-primary" data-toggle="modal" data-target="#payreg_Modal" @click="clickSalePayreg(salePayregIndex,'salePayreg')" >登记</button> -->
											<button class="btn btn-sm btn-primary" data-toggle="modal" data-target="#payreg_down_Modal" @click="fastPayrey(salePayregIndex,'salePayreg')" >登记</button>
											<button class="btn btn-sm btn-default" data-toggle="modal" data-target="#payreg_remark_Modal" @click="clickSalePayregRemark(salePayregIndex)" >备注</button>
										</td>
									</tr>
								</tbody>
							</table>
						</div>
					</div>
					<div class="panel panel-default">
						<div class="panel-heading">支付记录</div>
						<div class="panel-body">
							<div class="row" style="padding:0.5em">
								<button class="btn btn-primary col-md-2 col-md-offset-10" data-toggle="modal" data-target="#payreg_down_Modal" @click="_clickSalePayreg()" >
									<span class="fa fa-plus"> 付款登记</span>
								</button>
							</div>
							<table class="table ntTable">
								<thead>
									<tr>
										<th>No.</th>
										<th>登记</th>
										<th>订单号</th>
										<th>支付类型</th>
										<th>支付日期</th>
										<th>金额</th>
										<th>确认</th>
										<th>状态</th>
										<th>操作</th>
									</tr>
								</thead>
								<tbody>
									<template v-if="payregList != undefined && payregList.length > 0">
										<tr v-for="(payregListItem,payregListIndex) in payregList">
											<td align="center">{{payregListIndex+1}}</td>
											<td>{{payregListItem.create_name}} <br> <small> {{payregListItem.create_at}}</small></td>
											<td>{{formatUnit(payregListItem.sale_id,'id')}}</td>
											<td>{{payregListItem.paytype_name}}</td> 
											<td>{{payregListItem.pay_day}}<br><span class="green" v-if="daysBetween(saleList.create_time,payregListItem.pay_day) > 0">+ {{daysBetween(saleList.create_time,payregListItem.pay_day)}}D</span></td>
											<td align="right"> {{formatUnit(payregListItem.amount,'BRL')}} <small class="unit">BRL</small></td>
											<td> {{payregListItem.check_name}} <br> <small> {{payregListItem.check_time}}</small></td>
											<td> 
												<span class="text-success" v-if="payregListItem.status == 1">完成</span> 
												<span class="text-danger" v-if="payregListItem.status == 2">失败</span>
												<span class="text-primary" v-if="payregListItem.status == 3">收到</span>
												<span class="text-warning" v-if="payregListItem.status == 4">确认中</span>
											</td>
											<td align="right">
												<template v-if="payregListItem.status == 4">
													<button class="btn btn-sm btn-primary" data-toggle="modal" data-target="#payreg_Modal" @click="clickSalePayreg(payregListIndex,'payregList')">编辑</button>
													<button class="btn btn-sm btn-default" @click="modalEditAndDel(payregListIndex,'del','payregList')">删除</button>
													<button class="btn btn-sm btn-danger option-clear" @click="modalEditAndDel(payregListIndex,'clear','payregList')" v-show="admin_id == 1 && payregListItem.del_at > 0">清除</button>
												</template>
											</td>
										</tr>
									</template>
									<template v-else>
			                            <tr style="text-align: center;" >
			                                <td colspan="9" class="no_date" style="line-height: 10rem">{:lang('no_data')} </td>
			                            </tr>
									</template>
								</tbody>
							</table>
						</div>
					</div>
				</div>
			</div>
		</div>

		<!-- 送货单 -->
		<div class="tab-pane" id="delivery">
			<div class="row">
				<div class="col-md-12">
					<div class="panel panel-default">
						<table class="table table-hover table-striped">
							<thead>
								<tr>
									<th>#</th>
									<th width="25%">公司</th>
									<th>产品</th>
									<th>箱规</th>
									<th>数量</th>
									<th>编辑</th>
									<th>操作</th>
								</tr>
							</thead>
							<tbody>
								<template v-for="(deliveryNoteListItem,deliveryNoteListIndex) in deliveryNoteList" v-if="deliveryNoteList.length > 0">
									<tr v-for="(detailItem,detailIndex) in deliveryNoteListItem.detail">
										<template v-if="detailIndex == 0">
											<td><a href="sale.detail.php">{{formatUnit(detailItem.sale_id,'id')}}</a></td>
											<td>
												<a href="company.detail.php">{{deliveryNoteListItem.company_name}}</a><br>
												<span class="label label-info" v-if="deliveryNoteListItem.branch_name">分公司{{deliveryNoteListItem.branch_name}}</span>
											</td>
										</template>
										<template v-else>
											<td></td>
											<td></td>
										</template>
										<td>
											<div class="pro">
												<div class="pro-icon"><img :src="detailItem.proInfo.img_url" border="0" width="48px" height="48px" alt="ICON"></div>
												<div class="pro-name">
													<small>{{ formatUnit(detailItem.proInfo.prochar_id,'id') + (detailItem.proInfo.brand_name ? ' / ' + detailItem.proInfo.brand_name : '') + (detailItem.proInfo.model ? ' / ' + detailItem.proInfo.model : '') }}</small> <br />{{detailItem.proInfo.pro_name}}
												</div>
											</div>
										</td>
										<td align="right">
											{{ formatUnit(detailItem.proInfo.prochar_qty,'PCS')}}<small class="unit">PCS/CTN</small><br>
											{{detailItem.proInfo.ctn_size}}<small class="unit">CM</small>
										</td>
										<td align="right">{{detailItem.ty}}<small class="unit">PCS</small></td>
										<td>{{detailItem.create_name}}<br>{{detailItem.create_time}}</td>
										<template v-if="detailIndex == 0">
											<td align="right">
												<button class="btn btn-sm btn-default" data-toggle="modal" data-target="#delivery_detailModal" @click="deliveryNoteDetail(deliveryNoteListIndex)">详情</button>
												<a :href="'/admin/sale/deliveryNoteList?id='+deliveryNoteListItem.sale_id+'&deliveryNoteId='+deliveryNoteListItem.id+'&viewType=edit'" class="btn btn-sm btn-primary" >编辑</a>
												<button class="btn btn-sm btn-warning" @click="deliveryNoteLock(deliveryNoteListItem.id)" v-if="deliveryNoteListItem.lock_at == 0">暂停</button>
											</td>
										</template>
										<template v-else><td></td></template>
									</tr>
								</template>
								<template v-else>
									<tr style="text-align: center;">
		                                <td colspan="7" class="no_date" style="line-height: 10rem">{:lang('no_data')} </td>
		                            </tr>	
								</template>
								
							</tbody>
						</table>
					</div>
				</div>
			</div>
		</div>

		<!-- 订单记录 -->
		<div class="tab-pane" id="log">
			<div class="row">
				<div class="col-md-12">
					<table class="table table-striped ntTable">
						<thead>
							<tr>
								<th>时间</th>
								<th>订单进度</th>
								<th>编辑</th>
							</tr>
						</thead>
						<tbody>
							<tr v-for="(saleLogItem,saleLogIndex) in saleLog">
								<td>{{saleLogItem.create_time}}</td>
								<td>{{saleLogItem.remark}}</td>
								<td>{{saleLogItem.create_name}}</td>
							</tr>
						</tbody>
					</table>
				</div>
			</div>
		</div>
	</div>
  </div>
</div>

<!-- 订单备注 弹窗部分-->
<div class="modal fade" id="remark_Modal" tabindex="-1" role="dialog" aria-labelledby="ntModalLabel4" aria-hidden="true">
    <div class="modal-dialog modal-lg" style="width:80%">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                <h4 class="modal-title" id="ntModalLabel4">订单( {{publicInfo.saleOrderNo == '-' ? publicInfo.saleOrderNo : formatUnit(publicInfo.saleOrderNo,'id')}} )备注</h4>
            </div>
            <div class="modal-body">
                <div class="row">
                    <div class="col-md-12">
                        <div class="alert alert-dismissable alert-info">
                            <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
                             * <br>
                        </div>
                    </div>
                </div>
				<div class="row" style="padding:0.5em">
					<div class="col-md-2">
						订单<br>
						<small>{{publicInfo.saleOrderNo == '-' ? publicInfo.saleOrderNo : formatUnit(publicInfo.saleOrderNo,'id')}}</small>
					</div>
					<div class="col-md-10">
						公司<br>
						<small>{{publicInfo.companyId +( publicInfo.companyName ? " / " + publicInfo.companyName :'' )}} </small>
					</div>
				</div>
				<div class="row">
                    <div class="col-md-2">
						<button class="btn btn-checkbox">
							<input type="checkbox" @click="setOrderRemarkprivate(orderRemarkprivate)"> 私有
						</button>
					</div>
					<div class="col-md-10">
						<div class="input-group">
							<input type="text" class="form-control" id="orderRemarks" >
							<input type="hidden" class="form-control" id="orderRemarksKey" value="-1">
							<div class="input-group-btn">
								<button class="btn btn-primary" @click="setSaleOrderRemarkData()">保存</button>
							</div>
						</div>
					</div>
				</div>
				<div class="row">
                    <div class="col-md-12">
                        <table class="table table-hover ntTable">
							<thead>
								<tr>
									<td>No.</td>
									<td style="min-width: 30vw">内容</td>
									<td>私有</td>
									<td>管理员</td>
									<td>操作</td>
								</tr>
							</thead>
                            <tbody>
								<tr v-for="(saleOrderRemarkDataItem,saleOrderRemarkDataIndex) in saleOrderRemarkData">
									<td align="center">{{saleOrderRemarkDataItem.viewid}}</td>
									<td>{{saleOrderRemarkDataItem.content}}</td>
									<td>{{saleOrderRemarkDataItem.private ? "O" : '-'}}</td>
									<td>{{saleOrderRemarkDataItem.create_name}} / {{saleOrderRemarkDataItem.create_at}}</td>
									<td align="right">
										<button class="btn btn-sm btn-primary" @click="modalEditAndDel(saleOrderRemarkDataIndex,'edit','saleOrderRemarkData')">编辑</button>
										<button class="btn btn-sm btn-default" @click="modalEditAndDel(saleOrderRemarkDataIndex,'del','saleOrderRemarkData')">删除</button>
									</td>
								</tr>
							</tbody>
                        </table>
                    </div>
                </div>
			</div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal"><span class="glyphicon glyphicon-remove"></span>取消</button>
                <button type="button" class="btn btn-primary" data-dismiss="modal" style="padding-left:24px;padding-right:24px"><span class="glyphicon glyphicon-floppy-disk"></span>保存</button>
            </div>
        </div>
    </div>
</div>

<!-- 产品备注 弹窗部分-->
<div class="modal fade" id="pro_remark_Modal" tabindex="-1" role="dialog" aria-labelledby="ntModalLabel" aria-hidden="true">
    <div class="modal-dialog modal-lg" style="width:80%">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                <h4 class="modal-title" id="ntModalLabel">订单({{publicInfo.saleOrderNo == '-' ? publicInfo.saleOrderNo : formatUnit(publicInfo.saleOrderNo,'id')}})产品备注</h4>
            </div>
            <div class="modal-body">
                <div class="row">
                    <div class="col-md-12">
                        <div class="alert alert-dismissable alert-info">
                            <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
							 <p></p>
                        </div>
                    </div>
                </div>
				<div class="row">
					<div class="col-md-12">
						<table class="table ntTable">
							<thead>
								<tr>
									<th>&nbsp;</th>
									<th>产品</th>
									<th>箱规</th>
									<th>数量</th>
									<th>单价</th>
									<th>合计</th>
								</tr>
							</thead>
							<tbody>
								<tr>
									<td><img :src="remarksData.img_url" border="0" width="48px" height="48px"></td>
									<td><small>{{remarksData.prochar_id + (remarksData.brand_name ? " / " + remarksData.brand_name : '' )  + (remarksData.model ? " / " + remarksData.model : '' ) }} </small> <br />{{( remarksData.pro_name ? remarksData.pro_name : '' ) }}</td>
									<td align="right">
										{{remarksData.prochar_qty}} <small class="unit">PCS/CTN</small><br>
										{{remarksData.ctn_size}} <small class="unit">CM</small>
									</td>
									<td align="right">{{remarksData.orderNum}} <small class="unit">PCS</small></td>s
									<td align="right">
										{{remarksData.orderPrice}} <small class="unit">BRL</small><br>
									</td>
									<td align="right">
										{{remarksData.orderNum * remarksData.orderPrice}} <small class="unit">BRL</small><br>
									</td>
								</tr>
							</tbody>
						</table>
					</div>
				</div>
				<div class="row">
                    <div class="col-md-4">
						<button class="btn btn-checkbox">
							<input type="checkbox" name="remarksType" id="remarksTypePrivate" v-model="private"> 私有
						</button>
						<button class="btn btn-checkbox" >
							<input type="checkbox" name="remarksType" id="remarksTypeAdd" v-model="add" > 加工
						</button>
						<button class="btn btn-checkbox">
							<input type="checkbox" name="remarksType" id="remarksTypeRationed" v-model="rationed"> 给配单
						</button>
					</div>
					<div class="col-md-8">
						<div class="input-group">
							<input type="text" class="form-control"  id="remarksContent">
							<input type="hidden" class="form-control"  id="remarksContentkey" value="-1">
							<div class="input-group-btn">
								<button class="btn btn-primary" @click="addRemarks()">保存</button>
							</div>
						</div>
					</div>
				</div>
				<div class="row">
                    <div class="col-md-12">
                        <table class="table table-hover ntTable">
							<thead>
								<tr>
									<td>No.</td>
									<td style="min-width: 30vw">内容</td>
									<td>私有</td>
									<td>加工</td>
									<td>配单</td>
									<td>编辑</td>
									<td>操作</td>
								</tr>
							</thead>
                            <tbody>
								<tr v-for="(addRemarksDataItem,addRemarksDataIndex) in addRemarksData">
									<td align="center">{{addRemarksDataItem.viewid}}</td>
									<td>{{addRemarksDataItem.content}}</td>
									<td>{{addRemarksDataItem.private ? 'O' : '-'}}</td>
									<td>{{addRemarksDataItem.add ? 'O' : '-'}}</td>
									<td>{{addRemarksDataItem.rationed ? 'O' : '-'}}</td>
									<td>{{addRemarksDataItem.create_name}} / {{addRemarksDataItem.create_at}}</td>
									<td align="right">
										<button class="btn btn-sm btn-primary" @click="modalEditAndDel(addRemarksDataIndex,'edit','addRemarksData')">编辑</button>
										<button class="btn btn-sm btn-default" @click="modalEditAndDel(addRemarksDataIndex,'del','addRemarksData')">删除</button>
									</td>
								</tr>
							</tbody>
                        </table>
                    </div>
                </div>
			</div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal"><span class="glyphicon glyphicon-remove"></span>取消</button>
                <button type="button" class="btn btn-primary" data-dismiss="modal" style="padding-left:24px;padding-right:24px" @click="saveProListRemarks(remarksData.key)"><span class="glyphicon glyphicon-floppy-disk"></span>保存</button>
            </div>
        </div>
    </div>
</div>

<!-- 折扣弹窗部分-->
<div class="modal fade" id="pro_discount_Modal" tabindex="-1" role="dialog" aria-labelledby="ntModalLabel1" aria-hidden="true">
    <div class="modal-dialog modal-lg" style="width:60%">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                <h4 class="modal-title" id="ntModalLabel1">{{publicInfo.saleOrderNo == '-' ? publicInfo.saleOrderNo : formatUnit(publicInfo.saleOrderNo,'id')}}产品折扣</h4>
            </div>
            <div class="modal-body">
                <div class="row">
                    <div class="col-md-12">
                        <div class="alert alert-dismissable alert-info">
                            <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
                            <p></p>
                        </div>
                    </div>
                </div>
				<div class="row">
					<div class="col-md-2 col-md-offset-10" id="discount_type">
						<button class="btn btn-default btn-radio">
							<input name="discount_type" type="radio" value="1" checked> 百份比
						</button>
						<button class="btn btn-default btn-radio">
							<input name="discount_type" type="radio" value="2"> 金额
						</button>
                    </div>
				</div>
				<div class="row">
					<div class="col-md-12">
						<table class="table ntTable">
							<thead>
								<tr>
									<th>&nbsp;</th>
									<th>产品</th>
									<th>箱规</th>
									<th>数量</th>
									<th>单价</th>
									<th width="15%">折扣</th>
									<th>合计</th>
									<th>差额</th>
								</tr>
							</thead>
							<tbody>
								<tr>
									<td><img :src="discountData.img_url" border="0" width="48px" height="48px"></td>
									<td><small>{{discountData.prochar_id + (discountData.brand_name ? " / " + discountData.brand_name : '' )  + (discountData.model ? " / " + discountData.model : '' ) }} </small> <br />{{( discountData.pro_name ? discountData.pro_name : '' ) }}</td>
									<td align="right">
										{{discountData.prochar_qty}} <small class="unit">PCS/CTN</small><br>
										{{discountData.ctn_size}} <small class="unit">CM</small>
									</td>
									<td align="right">{{discountData.orderNum}} <small class="unit">PCS</small></td>
									<td align="right">
										{{discountData.orderPrice}} <small class="unit">BRL</small><br>
										<span class="green">{{discountData.discountPrice}}</span> <small class="unit">BRL</small>
									</td>
									<td>
										<div class="input-group" >
											<input type="number" id='discount' class="form-control text-right" :value="discountData.discount" @input="setDiscount()">
											<span class="input-group-addon" id="discount_mark">%</span>
										</div>
									</td>
									<td align="right">
										{{discountData.orderNum*discountData.orderPrice}} <small class="unit">BRL</small><br>
										<span class="green">{{discountData.discountPriceSum}}</span> <small class="unit">BRL</small>
									</td>
									<td align="right">
										<span class="green">{{discountData.orderNum*discountData.orderPrice - discountData.discountPriceSum}}</span> <small class="unit">BRL</small>
									</td>
								</tr>
							</tbody>
						</table>
					</div>
				</div>
			</div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal"><span class="glyphicon glyphicon-remove"></span>取消</button>
                <button type="button" class="btn btn-primary" data-dismiss="modal" style="padding-left:24px;padding-right:24px" @click="discountSave()"><span class="glyphicon glyphicon-floppy-disk"></span >保存</button>
            </div>
        </div>
    </div>
</div>


<!-- 提成弹窗部分-->
<div class="modal fade" id="pro_commission_Modal" tabindex="-1" role="dialog" aria-labelledby="ntModalLabel3" aria-hidden="true">
    <div class="modal-dialog modal-lg" style="width:60%">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                <h4 class="modal-title" id="ntModalLabel3">订单({{publicInfo.saleOrderNo == '-' ? publicInfo.saleOrderNo : formatUnit(publicInfo.saleOrderNo,'id')}})产品提成</h4>
            </div>
            <div class="modal-body">
                <div class="row">
                    <div class="col-md-12">
                        <div class="alert alert-dismissable alert-info">
                            <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
                            <p></p>
                        </div>
                    </div>
                </div>
				<div class="row">
					<div class="col-md-12">
						<table class="table ntTable">
							<thead>
								<tr>
									<th>&nbsp;</th>
									<th>产品</th>
									<th>箱规</th>
									<th>数量</th>
									<th>单价</th>
									<th>合计</th>
									<th width="15%">提成</th>
									<th>&nbsp;</th>
								</tr>
							</thead>
							<tbody>
								<tr>
									<td><img :src="commissionData.img_url" border="0" width="48px" height="48px"></td>
									<td><small>{{commissionData.prochar_id + (commissionData.brand_name ? " / " + commissionData.brand_name : '' )  + (commissionData.model ? " / " + commissionData.model : '' ) }} </small> <br />{{( commissionData.pro_name ? commissionData.pro_name : '' ) }}</td>
									<td align="right">
										{{commissionData.prochar_qty}} <small class="unit">PCS/CTN</small><br>
										{{commissionData.ctn_size}} <small class="unit">CM</small>
									</td>
									<td align="right">{{commissionData.orderNum}} <small class="unit">PCS</small></td>s
									<td align="right">
										{{commissionData.orderPrice}} <small class="unit">BRL</small><br>
									</td>
									<td align="right">
										{{commissionData.orderNum * commissionData.orderPrice}} <small class="unit">BRL</small><br>
									</td>
									<td>
										<div class="input-group" >
											<input type="number" class="form-control text-right" id="commission" :value="commissionData.commission" @input="setCommission()">
											<span class="input-group-addon">%</span>
										</div>
									</td>
									<td align="right">
										<span class="blue">{{commissionData.commissionPrice}}</span> <small class="unit">BRL</small>
									</td>
								</tr>
							</tbody>
						</table>
					</div>
				</div>
			</div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal"><span class="glyphicon glyphicon-remove"></span>取消</button>
                <button type="button" class="btn btn-primary" data-dismiss="modal" style="padding-left:24px;padding-right:24px" @click="commissionSave()"><span class="glyphicon glyphicon-floppy-disk"></span >保存</button>
            </div>
        </div>
    </div>
</div>

<!-- 付款安排备注 弹窗部分-->
<div class="modal fade" id="payment_remark_Modal" tabindex="-1" role="dialog" aria-labelledby="ntModalLabel7" aria-hidden="true">
    <div class="modal-dialog modal-lg" style="width:60%">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                <h4 class="modal-title" id="ntModalLabel7">订单({{publicInfo.saleOrderNo == '-' ? publicInfo.saleOrderNo : formatUnit(publicInfo.saleOrderNo,'id')}})付款安排备注</h4>
            </div>
            <div class="modal-body">
                <div class="row">
                    <div class="col-md-12">
                        <div class="alert alert-dismissable alert-info">
                            <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
                            <p></p>
                        </div>
                    </div>
                </div>
				<div class="panel panel-info">
					<div class="row" style="padding:1em">
						<div class="col-md-2">
							<small>订单</small><br>
							{{publicInfo.saleOrderNo == '-' ? publicInfo.saleOrderNo : formatUnit(publicInfo.saleOrderNo,'id')}}
						</div>
						<div class="col-md-6">
							<small>客户</small><br>
							{{publicInfo.companyId + (publicInfo.companyName ? ' / '+publicInfo.companyName:'') }}
						</div>
						<div class="col-md-4">
							<small>付款安排</small><br>
							{{publicInfo.paymentName + (publicInfo.paymentCreate_at ? ' / '+publicInfo.paymentCreate_at:'') + (publicInfo.paymentAmount ? ' / '+publicInfo.paymentAmount:'' ) }} <small class="unit">BRL</small>
						</div>
					</div>
				</div>

				<div class="row">
                    <div class="col-md-2">
						备注内容<span class="required"></span>
					</div>
					<div class="col-md-10">
						<div class="input-group">
							<input type="text" class="form-control" value="" id="paymentRemarksContent">
							<input type="hidden" id="paymentRemarksContentKey" value="-1">
							<div class="input-group-btn">
								<button class="btn btn-primary" @click="setpaymentRemarksList()"><span class="fa fa-save"></span> 添加</button>
							</div>
						</div>
					</div>
				</div>
				<div class="row">
                    <div class="col-md-12">
                        <table class="table table-hover ntTable">
							<thead>
								<tr>
									<td>No.</td>
									<td style="min-width: 30vw">内容</td>
									<td>编辑</td>
									<td>操作</td>
								</tr>
							</thead>
                            <tbody>
								<tr v-for="(paymentRemarksDataListItem,paymentRemarksDataListIndex) in paymentRemarksDataList">
									<td align="center">{{paymentRemarksDataListIndex+1}}</td>
									<td>{{paymentRemarksDataListItem.content}}</td>
									<td>{{ (paymentRemarksDataListItem.create_name ? paymentRemarksDataListItem.create_name + ' / ': '') + paymentRemarksDataListItem.create_at}}</td>
									<td align="right">
										<button class="btn btn-sm btn-primary" @click="modalEditAndDel(paymentRemarksDataListIndex,'edit','paymentRemarksDataList')">编辑</button>
										<button class="btn btn-sm btn-default" @click="modalEditAndDel(paymentRemarksDataListIndex,'del','paymentRemarksDataList')">删除</button>
									</td>
								</tr>
							</tbody>
                        </table>
                    </div>
                </div>
			</div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal"><span class="glyphicon glyphicon-remove"></span>关闭</button>
                <button type="button" class="btn btn-primary" data-dismiss="modal" style="padding-left:24px;padding-right:24px" @click="savePaymentRemarks(publicInfo.key)"><span class="glyphicon glyphicon-floppy-disk"></span>保存</button>
            </div>
        </div>
    </div>
</div>

<!-- 快捷付款登记弹窗部分-->
<div class="modal fade" id="payreg_Modal" tabindex="-1" role="dialog" aria-labelledby="ntModalLabel9" aria-hidden="true">
    <div class="modal-dialog modal-lg" style="width:70%">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                <h4 class="modal-title" id="ntModalLabel9">订单( {{publicInfo.saleOrderNo == '-' ? publicInfo.saleOrderNo : formatUnit(publicInfo.saleOrderNo,'id')}} ){{publicInfo.title}}</h4>
            </div>
            <div class="modal-body">
                <div class="row">
                    <div class="col-md-12">
                        <div class="alert alertPayreg alert-dismissable alert-info">
                            <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
                            <p></p>
                        </div>
                    </div>
                </div>
				<div class="panel panel-info">
					<div class="row" style="padding:1em">
						<div class="col-md-2">
							<small>订单</small><br>
							{{publicInfo.saleOrderNo == '-' ? publicInfo.saleOrderNo : formatUnit(publicInfo.saleOrderNo,'id')}}
						</div>
						<div class="col-md-6">
							<small>客户</small><br>
							{{publicInfo.companyId + (publicInfo.companyName ? ' / '+publicInfo.companyName:'') }}
						</div>
						<div class="col-md-4">
							<small>付款安排</small><br>
							{{publicInfo.paymentName}} / {{publicInfo.paymentDay}} / {{publicInfo.paymentAmount}} <small class="unit">BRL</small>
						</div>
					</div>
				</div>
				<div class="row">
					<div class="col-md-12">
						<ul class="nav nav-tabs">
							<!-- <li :class="[publicInfo.paytype_id == 1 ? 'active' : '']" v-if="publicInfo.paytype_id == 1 || payregEdit" @click="payperyViewShow(1)"> -->
							<li :class="[publicInfo.paytype_id == 1 ? 'active' : '']" @click="payperyViewShow(1)">
								<a href="#payreg_cash" data-toggle="tab" >现金</a>
							</li>
							<!-- <li :class="[publicInfo.paytype_id == 2 ? 'active' : '']" v-if="publicInfo.paytype_id == 2 || payregEdit" @click="payperyViewShow(2)"> -->
							<li :class="[publicInfo.paytype_id == 2 ? 'active' : '']" @click="payperyViewShow(2)">
								<a href="#payreg_voucher" data-toggle="tab">代金券</a>
							</li>
							<!-- <li :class="[publicInfo.paytype_id == 3 || publicInfo.paytype_id == 4 ? 'active' : '']" v-if="publicInfo.paytype_id == 3 || publicInfo.paytype_id == 4 || payregEdit" @click="payperyViewShow(3)"> -->
							<li :class="[publicInfo.paytype_id == 3 || publicInfo.paytype_id == 4 ? 'active' : '']"  @click="payperyViewShow(3)">
								<a href="#payreg_cheque" data-toggle="tab">
									现金支票 / 期票
								</a>
							</li>
							<!-- <li :class="[publicInfo.paytype_id == 5 ? 'active' : '']" v-if="publicInfo.paytype_id == 5 || payregEdit" @click="payperyViewShow(5)"> -->
							<li :class="[publicInfo.paytype_id == 5 ? 'active' : '']"  @click="payperyViewShow(5)">
								<a href="#payreg_transfer" data-toggle="tab">
									转账
								</a>
							</li>
						</ul>
					</div>
				</div>
				<div class="row" style="padding: 1em">
					<div class="col-md-12">
						<div class="tab-content">

							<!-- 现金 付款登记 -->
							<div class="tab-pane active" id="payreg_cash"  style="display: none;">
								<div class="row">
									<div class="col-md-2">金额<span class="required"></span></div>
									<div class="col-md-3" ><input type="number" class="form-control" id="payregAmount" :value="formatUnit(publicInfo.paymentAmount,'BRL')" readonly style="text-align: right;"></div>
									<div class="col-md-2">日期<span class="required"></span></div>
									<div class="col-md-3" id="payregCashPayDay">{{create_at}}</div>
								</div>

							</div>

							<!-- 代金券 付款登记 -->
							<div class="tab-pane active" id="payreg_voucher" style="display: none;">
								<div class="row">
									<div class="col-md-1">代金券<span class="required"></span></div>
									<div class="col-md-9">
										<select name="" id="voucher" class="form-control" v-model="payregChequeInfo.voucherId">
											<option value="-1">请选择要使用的代金券</option>
											<option :value="voucherListIndex" v-for="(voucherListItem,voucherListIndex) in voucherList">{{formatUnit( voucherListItem.id,'id') +' / '+ voucherListItem.amount + ' BRL / '+ voucherListItem.valid_time }}</option>
										</select>
									</div>
									<button class="col-md-2 btn btn-primary" @click="clickUseVoucher(publicInfo.key)"><span class="fa fa-plus"> 使用</span></button>
								</div>
								<div class="row">
									<table class="table ntTable">
										<thead>
											<tr>
												<th>No.</th>
												<th>代金券编号</th>
												<th>金额</th>
												<th>有效期</th>
												<th>操作</th>
											</tr>
										</thead>
										<tbody>
											<template v-if="voucherData != undefined && voucherData.length > 0">
												<tr v-for="(voucherDataItem,voucherDataIndex) in voucherData">
													<td align="center">1</td>
													<td>{{formatUnit( voucherDataItem.id,'id')}}</td>
													<td align="right">{{formatUnit(voucherDataItem.amount,'BRL')}} <small class="unit">BRL</small></td>
													<td align="center">{{voucherDataItem.valid_time}}</td>
													<td align="right">
														<button class="btn btn-sm btn-default" @click="modalEditAndDel(voucherDataIndex,'del','voucherData')">删除</button>
													</td>
												</tr>	
											</template>
											<template v-else>
					                            <tr style="text-align: center;" >
					                                <td colspan="5" class="no_date" style="line-height: 10rem">{:lang('no_data')} </td>
					                            </tr>
											</template>
										</tbody>
										<tfoot>
											<tr>
												<td colspan="4" align="right">合计：{{formatUnit(voucherPriceSum[publicInfo.key],'BRL')}} <small class="unit">BRL</small></td>
												<td>&nbsp;</td>
											</tr>
										</tfoot>
									</table>
								</div>
							</div>

							<!-- 支票 付款登记 -->
							<div class="tab-pane active" id="payreg_cheque"  style="display: none;">
								<div class="row" style="padding: 0.1em">
									<div class="col-md-1">银行<span class="required"></span></div>
									<div class="col-md-4">
										<select name="" id="chequeBank" class="form-control" >
											<option value="-1">请选择支票所在的银行</option>
											<option :value="bankListIndex" v-for="(bankListItem,bankListIndex) in bankList">{{bankListItem.name}}</option>
										</select>
									</div>
									<div class="col-md-1">票号<span class="required"></span></div>
									<div class="col-md-2"><input type="text" class="form-control" id="chequeNo" :value="payregChequeInfo.chequeNoValue"></div>
									<div class="col-md-1">署名<span class="required"></span></div>
									<div class="col-md-2"><input type="text" class="form-control" id="chequeSignature" :value="payregChequeInfo.chequeSignature"></div>
									<input type="hidden" id="chequeNoKey" v-model="payregChequeInfo.chequeNoKey">
									<input type="hidden" id="chequeNoEditKey" value="-1">
								</div>
								<div class="row" style="padding: 0.1em">
									<div class="col-md-1">扫描</div>
									<div class="col-md-4">
										<div class="input-group">
											<input type="text" class="form-control" id="chequeScan_url" :value="payregChequeInfo.chequeScan_url" placeholder="扫描文件小于2MB,格式为.JPG/.JPGE/.PNG/.GIF">
											<div class="input-group-btn">
												<button class="btn btn-default">
													<span class="fa fa-cloud-upload-alt"></span> 上传
												</button>
											</div>
										</div>
									</div>
									<div class="col-md-1">投递日期<span class="required"></span></div>
									<div class="col-md-2">
										<div class="input-group date form_datetime" :data-date="payregChequeInfo.chequeDay" data-date-format="yyyy-mm-dd" data-link-field="payreg_pay_day">
											<input class="form-control text-center" type="text" id="chequeDay" :value="payregChequeInfo.chequeDay">
											<span class="input-group-addon"><span class="glyphicon glyphicon-calendar" style="margin:0"></span></span>
										</div>
										<input type="hidden" id="payreg_pay_day" :value="payregChequeInfo.chequeDay" />
									</div>
									<div class="col-md-1">金额<span class="required" ></span></div>
									<div class="col-md-2"><input type="number" class="form-control text-right" id="chequePrice" :value="payregChequeInfo.chequePrice"></div>
									<div class="col-md-1 text-right">
										<button class="btn btn-primary"><span class="fa fa-plus" @click="setChequeDay(publicInfo.key)"> 确定</span></button>
									</div>
								</div>
								<div class="row">
									<div class="col-md-12">
										<table class="table ntTable">
											<thead>
												<tr>
													<th>No.</th>
													<th>银行</th>
													<th>票号</th>
													<th>署名</th>
													<th>存款日期</th>
													<th>金额</th>
													<th>签收</th>
													<th>扫描</th>
													<th>操作</th>
												</tr>
											</thead>
											<tbody>
												<template v-if="PayeryChequeData != undefined && PayeryChequeData.length > 0">
												<tr v-for="(PayeryChequeDataItem,PayeryChequeDataIndex) in PayeryChequeData">
													<td align="center">{{PayeryChequeDataIndex+1}}</td>
													<td>{{PayeryChequeDataItem.bank_name}}</td>
													<td>{{PayeryChequeDataItem.chequeNo}}</td>
													<td>{{PayeryChequeDataItem.chequeSignature}}</td>
													<td>{{PayeryChequeDataItem.chequeDay}}</td>
													<td align="right">{{formatUnit(PayeryChequeDataItem.chequePrice,'BRL')}} <small class="unit">BRL</small></td>
													<td>{{create_name}} <br> <small>{{create_at}}</small></td>
													<td v-if="PayeryChequeDataItem.chequeScan_url">
														<button class="btn btn-sm btn-default">查看</button>
													</td>
													<td v-else>-</td>
													<td align="right">
														<button class="btn btn-sm btn-primary" @click="payeryClickEdit(PayeryChequeDataIndex,'PayeryChequeData')">编辑</button>
														<button class="btn btn-sm btn-default" @click="modalEditAndDel(PayeryChequeDataIndex,'del','PayeryChequeData')">删除</button>
													</td>
												</tr>	
												</template>
												<template v-else>
						                            <tr style="text-align: center;" >
						                                <td colspan="9" class="no_date" style="line-height: 10rem">{:lang('no_data')} </td>
						                            </tr>
												</template>
											</tbody>
											<tfoot>
												<tr>
													<td colspan="7" align="right">合计：{{formatUnit(chequePriceSum[publicInfo.key],'BRL')}} <small class="unit">BRL</small></td>
													<td colspan="2">&nbsp;</td>
												</tr>
											</tfoot>
										</table>
									</div>
								</div>
							</div>

							<!-- 转账 付款登记 -->
							<div class="tab-pane active" id="payreg_transfer" style="display: none;">
								<div class="row" style="padding: 0.1em">
									<div class="col-md-1">支付账号</div>
									<div class="col-md-6">
										<!-- <select name="" id="transferOutId" class="form-control" v-model="payregChequeInfo.transferOutIdValue"> -->
										<select name="" id="transferOutId" class="form-control">
											<option value="-1">请选择支付账号</option>
											<option :value="bankListIndex1" v-for="(bankListItem1,bankListIndex1) in co_bank">{{bankListItem1.account_num}}</option>
											<!-- <option value="0">0表示现金存款</option>
											<option value="">nt_co_bank 列表</option> -->
										</select>
									</div>
									<div class="col-md-1">存款日期<span class="required"></span></div>
									<div class="col-md-4">
										<div class="input-group date form_datetime" :data-date="payregChequeInfo.payreg_transfer_pay_dayValue" data-date-format="yyyy-mm-dd" data-link-field="payreg_transfer_pay_day1">
											<input class="form-control text-center" type="text" :value="payregChequeInfo.payreg_transfer_pay_dayValue" id="transferDay">
											<span class="input-group-addon"><span class="glyphicon glyphicon-calendar" style="margin:0"></span></span>
										</div>
										<input type="hidden" id="payreg_transfer_pay_day"  />
									</div>
								</div>

								<div class="row" style="padding: 0.1em">
									<div class="col-md-1">存入账号<span class="required"></span></div>
									<div class="col-md-6">
										<!-- <select name="" id="transferInId" class="form-control" v-model="payregChequeInfo.transferInIdValue"> -->
										<select name="" id="transferInId" class="form-control">
											<option value="-1">选择存入的银行账号</option>
											<option :value="receivingAccountIndex1" v-for="(receivingAccountItem1,receivingAccountIndex1) in receivingAccount">{{receivingAccountItem1.accoun}}</option>
										</select>
									</div>
									<div class="col-md-1">金额<span class="required"></span></div>
									<div class="col-md-4"><input type="number" class="form-control text-right" id="transferPrice" :value="payregChequeInfo.transferPriceValue"></div>
								</div>
								<input type="hidden" id="transferKey" v-model="payregChequeInfo.transferKey">
								<input type="hidden" id="transfereditKey" value="-1">
								<div class="row" style="padding: 0.1em">
									<div class="col-md-1">流水号<span class="required"></span></div>
									<div class="col-md-4"><input type="text" class="form-control" placeholder="在付款登记中，流水号是必需的" id="transferNo" :value="payregChequeInfo.transferNoValue"></div>
									<div class="col-md-1">扫描</div>
									<div class="col-md-4">
										<div class="input-group">
											<input type="text" class="form-control" id="transferScan_url" placeholder="扫描文件小于2MB,格式为.JPG/.JPGE/.PNG/.GIF" id="transferscan_url" v-model="payregChequeInfo.transferscan_url">
											<div class="input-group-btn">
												<button class="btn btn-default">
													<span class="fa fa-cloud-upload-alt"></span> 上传
												</button>
											</div>
										</div>
									</div>
									<div class="col-md-2 text-right">
										<button class="btn btn-primary" style="width:10em" @click="setTransferData(publicInfo.key)"><span class="fa fa-plus"> 确定</span></button>
									</div>
								</div>

								<div class="row">
									<div class="col-md-12">
										<table class="table ntTable">
											<thead>
												<tr>
													<th>No.</th>
													<th>付款账号</th>
													<th>存款日期</th>
													<th>存入账号</th>
													<th>金额</th>
													<th>流水号</th>
													<th>扫描</th>
													<th>操作</th>
												</tr>
											</thead>
											<tbody>
												<template v-if="payerytransferData != undefined && payerytransferData.length > 0">
													<tr v-for="(payerytransferDataItem,payerytransferDataIndex) in payerytransferData">
														<td align="center">{{payerytransferDataItem.viewid}}</td>
														<td>{{payerytransferDataItem.transferOutName}}</td>
														<td>{{payerytransferDataItem.transferDay}}</td>
														<td>{{payerytransferDataItem.transferInName}}</td>
														<td align="right">{{formatUnit(payerytransferDataItem.transferPrice,'BRL')}}<small class="unit">BRL</small></td>
														<td>{{payerytransferDataItem.transferNo}}</td>
														<td v-if="payerytransferDataItem.transferscan_url">
															<button class="btn btn-sm btn-default">查看</button>
														</td>
														<td v-else>-</td>
														<td align="right">
															<button class="btn btn-sm btn-primary" @click="payeryClickEdit(payerytransferDataIndex,'payerytransferData')">编辑</button>
															<button class="btn btn-sm btn-default" @click="modalEditAndDel(payerytransferDataIndex,'del','payerytransferData')">删除</button>
														</td>
													</tr>	
												</template>
												<template v-else>
						                            <tr style="text-align: center;" >
						                                <td colspan="8" class="no_date" style="line-height: 10rem">{:lang('no_data')} </td>
						                            </tr>
												</template>
											</tbody>
											<tfoot>
												<tr>
													<td colspan="7" align="right">合计：{{formatUnit(transferPriceSum[publicInfo.key],'BRL')}}<small class="unit">BRL</small></td>
													<td colspan="2">&nbsp;</td>
												</tr>
											</tfoot>
										</table>
									</div>
								</div>
							</div>

						</div>

					</div>
				</div>

			</div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal"><span class="glyphicon glyphicon-remove"></span>取消</button>
                <button type="button" class="btn btn-primary" data-dismiss="modal" style="padding-left:24px;padding-right:24px"  @click="savePayery(publicInfo.key)"><span class="glyphicon glyphicon-floppy-disk" ></span>保存</button>
            </div>
        </div>
    </div>
</div>

<!-- 付款登记弹窗部分-->
<div class="modal fade" id="payreg_down_Modal" tabindex="-1" role="dialog" aria-labelledby="ntModalLabel9" aria-hidden="true">
    <div class="modal-dialog modal-lg" style="width:70%">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                <h4 class="modal-title" id="ntModalLabel9">订单( {{publicInfo.saleOrderNo == '-' ? publicInfo.saleOrderNo : formatUnit(publicInfo.saleOrderNo,'id')}} )付款登记</h4>
            </div>
            <div class="modal-body">
                <div class="row">
                    <div class="col-md-12">
                        <div class="alert alertPayreg alert-dismissable alert-info">
                            <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
                            <p></p>
                        </div>
                    </div>
                </div>
				<div class="panel panel-info">
					<div class="row" style="padding:1em">
						<div class="col-md-2">
							<small>订单</small><br>
							{{publicInfo.saleOrderNo == '-' ? publicInfo.saleOrderNo : formatUnit(publicInfo.saleOrderNo,'id')}}
						</div>
						<div class="col-md-6">
							<small>客户</small><br>
							{{publicInfo.companyId + (publicInfo.companyName ? ' / '+publicInfo.companyName:'') }}
						</div>
						<!-- <div class="col-md-4">
							<small>付款安排</small><br>
							{{salePayregRemarksData.paymentName}} / {{salePayregRemarksData.paymentDay}} / {{salePayregRemarksData.paymentAmount}} <small class="unit">BRL</small>
						</div> -->
					</div>
				</div>
				<div class="row">
					<div class="col-md-12">
						<ul class="nav nav-tabs">
							<li class="active" id="payreg_cash_head" @click="payperyViewShow(1,'_')">
								<a href="#payreg_cash_" data-toggle="tab" >现金</a>
							</li>
							<li @click="payperyViewShow(2,'_')">
								<a href="#payreg_voucher_" data-toggle="tab">代金券</a>
							</li>
							<li @click="payperyViewShow(3,'_')">
								<a href="#payreg_cheque_" data-toggle="tab">
									现金支票 / 期票
								</a>
							</li>
							<li @click="payperyViewShow(5,'_')">
								<a href="#payreg_transfer_" data-toggle="tab">
									转账
								</a>
							</li>
						</ul>
					</div>
				</div>
				<div class="row" style="padding: 1em">
					<div class="col-md-12">
						<div class="tab-content">

							<!-- 现金 付款登记 -->
							<div class="tab-pane active" id="payreg_cash_">
								<div class="row">
									<div class="col-md-2">金额<span class="required"></span></div> 
									<div class="col-md-3"><input type="number" class="form-control" id="payregAmount_" v-model="payregAmount_" style="text-align: right;"></div>
									<div class="col-md-2">日期<span class="required"></span></div>
									<div class="col-md-3">{{create_at}}</div>
								</div>
							</div>

							<!-- 代金券 付款登记 -->
							<div class="tab-pane" id="payreg_voucher_" >
								<div class="row">
									<div class="col-md-1">代金券<span class="required"></span></div>
									<div class="col-md-9">
										<select name="" id="voucher_" class="form-control">
											<option value="-1">请选择要使用的代金券</option>
											<option :value="voucherListIndex" v-for="(voucherListItem,voucherListIndex) in voucherList">{{formatUnit( voucherListItem.id,'id') +' / '+ voucherListItem.amount + ' BRL / '+ voucherListItem.valid_time }}</option>
										</select>
									</div>
									<button class="col-md-2 btn btn-primary" @click="clickUseVoucher(-1)"><span class="fa fa-plus"> 使用</span></button>
								</div>
								<div class="row">
									<table class="table ntTable">
										<thead>
											<tr>
												<th>No.</th>
												<th>代金券编号</th>
												<th>金额</th>
												<th>有效期</th>
												<th>操作</th>
											</tr>
										</thead>
										<tbody>
											<template v-if="voucherData_ != undefined && voucherData_.length > 0">
												<tr v-for="(_voucherDataItem,_voucherDataIndex) in voucherData_">
													<td align="center">{{_voucherDataIndex+1}}</td>
													<td>{{formatUnit( _voucherDataItem.id,'id')}}</td>
													<td align="right">{{formatUnit(_voucherDataItem.amount,'BRL')}} <small class="unit">BRL</small></td>
													<td align="center">{{_voucherDataItem.valid_time}}</td>
													<td align="right">
														<button class="btn btn-sm btn-default" @click="modalEditAndDel(_voucherDataIndex,'del','voucherData_')">删除</button>
													</td>
												</tr>	
											</template>
											<template v-else>
					                            <tr style="text-align: center;" >
					                                <td colspan="5" class="no_date" style="line-height: 10rem">{:lang('no_data')} </td>
					                            </tr>
											</template>
										</tbody>
										<tfoot>
											<tr>
												<td colspan="4" align="right">合计：{{formatUnit(voucherPriceSum[-1],'BRL')}} <small class="unit">BRL</small></td>
												<td>&nbsp;</td>
											</tr>
										</tfoot>
									</table>
								</div>
							</div>


							<!-- 支票 付款登记 -->
							<div class="tab-pane" id="payreg_cheque_" >
								<div class="row" style="padding: 0.1em">
									<div class="col-md-1">银行<span class="required"></span></div>
									<div class="col-md-4">
										<select name="" id="chequeBank_" class="form-control">
											<option value="-1">请选择支票所在的银行</option>
											<option :value="bankListIndex" v-for="(bankListItem,bankListIndex) in bankList">{{bankListItem.name}}</option>
										</select>
									</div>
									<div class="col-md-1">票号<span class="required"></span></div>
									<div class="col-md-2"><input type="text" class="form-control" id="chequeNo_"></div>
									<div class="col-md-1">署名<span class="required"></span></div>
									<div class="col-md-2"><input type="text" class="form-control" id="chequeSignature_"></div>

								</div>
								<div class="row" style="padding: 0.1em">
									<div class="col-md-1">扫描</div>
									<div class="col-md-4">
										<div class="input-group">
											<input type="text" class="form-control" id="chequeScan_url_" placeholder="扫描文件小于2MB,格式为.JPG/.JPGE/.PNG/.GIF">
											<div class="input-group-btn">
												<button class="btn btn-default">
													<span class="fa fa-cloud-upload-alt"></span> 上传
												</button>
											</div>
										</div>
									</div>
									<div class="col-md-1">投递日期<span class="required"></span></div>
									<div class="col-md-2">
										<div class="input-group date form_datetime" data-date="2019-12-12" data-date-format="yyyy-mm-dd" data-link-field="payreg_pay_day">
											<input class="form-control text-center" type="text" :value="create_at" id="chequeDay_">
											<span class="input-group-addon"><span class="glyphicon glyphicon-calendar" style="margin:0"></span></span>
										</div>
										<input type="hidden" id="payreg_pay_day" value="2019-12-12" />
									</div>
									<div class="col-md-1">金额<span class="required" ></span></div>
									<div class="col-md-2"><input type="number" class="form-control text-right" id="chequePrice_"></div>

									<input type="hidden" id="chequeNoEditKey_" value="-1">
									<div class="col-md-1 text-right">
										<button class="btn btn-primary"><span class="fa fa-plus" @click="setChequeDay(-1)"> 确定</span></button>
									</div>
								</div>
								<div class="row">
									<div class="col-md-12">
										<table class="table ntTable">
											<thead>
												<tr>
													<th>No.</th>
													<th>银行</th>
													<th>编号</th>
													<th>署名</th>
													<th>存款日期</th>
													<th>金额</th>
													<th>签收</th>
													<th>扫描</th>
													<th>操作</th>
												</tr>
											</thead>
											<tbody>
												<template v-if="PayeryChequeData_ != undefined && PayeryChequeData_.length > 0">
													<tr v-for="(_PayeryChequeDataItem,PayeryChequeDataIndex) in PayeryChequeData_">
														<td align="center">{{_PayeryChequeDataItem.viewid}}</td>
														<td>{{_PayeryChequeDataItem.bank_name}}</td>
														<td>{{_PayeryChequeDataItem.chequeNo}}</td>
														<td>{{_PayeryChequeDataItem.chequeSignature}}</td>
														<td>{{_PayeryChequeDataItem.chequeDay}}</td>
														<td align="right">{{formatUnit(_PayeryChequeDataItem.chequePrice,'BRL')}} <small class="unit">BRL</small></td>
														<td>{{create_name}} <br> <small>{{create_at}}</small></td>
														<td v-if="_PayeryChequeDataItem.chequeScan_url">
															<button class="btn btn-sm btn-default">查看</button>
														</td>
														<td v-else> - </td>
														<td align="right">
															<button class="btn btn-sm btn-primary" @click="payeryClickEdit(PayeryChequeDataIndex,'PayeryChequeData_')">编辑</button>
															<button class="btn btn-sm btn-default" @click="modalEditAndDel(PayeryChequeDataIndex,'del','PayeryChequeData_')">删除</button>
														</td>
													</tr>	
												</template>
												<template v-else>
						                            <tr style="text-align: center;" >
						                                <td colspan="9" class="no_date" style="line-height: 10rem">{:lang('no_data')} </td>
						                            </tr>
												</template>
											</tbody>
											<tfoot>
												<tr>
													<td colspan="7" align="right">合计：{{formatUnit(chequePriceSum[publicInfo.key],'BRL')}} <small class="unit">BRL</small></td>
													<td colspan="2">&nbsp;</td>
												</tr>
											</tfoot>
										</table>
									</div>
								</div>
							</div>

							<!-- 转账 付款登记 -->
							<div class="tab-pane " id="payreg_transfer_" >
								<div class="row" style="padding: 0.1em">
									<div class="col-md-1">支付账号</div>
									<div class="col-md-6">
										<select name="" id="transferOutId_" class="form-control">
											<option value="-1">请选择支付账号</option>
											<option :value="bankListIndex1" v-for="(bankListItem1,bankListIndex1) in co_bank">{{bankListItem1.account_num}}</option>
										</select>
									</div>
									<div class="col-md-1">存款日期<span class="required"></span></div>
									<div class="col-md-4">
										<div class="input-group date form_datetime" data-date="2019-12-12" data-date-format="yyyy-mm-dd" data-link-field="payreg_transfer_pay_day">
											<input class="form-control text-center" type="text" :value="create_at" id="transferDay_">
											<span class="input-group-addon"><span class="glyphicon glyphicon-calendar" style="margin:0"></span></span>
										</div>
										<input type="hidden" id="payreg_transfer_pay_day_" value="2019-12-12" />
									</div>

								</div>
								<div class="row" style="padding: 0.1em">
									<div class="col-md-1">存入账号<span class="required"></span></div>
									<div class="col-md-6">
										<select name="" id="transferInId_" class="form-control" >
											<option value="-1">选择存入的银行账号</option>
											<option :value="receivingAccountIndex1" v-for="(receivingAccountItem1,receivingAccountIndex1) in receivingAccount">{{receivingAccountItem1.accoun}}</option>
											<!-- <option value="">转账时，存入银行账号是必选内容</option>
											<option value="">nt_account 列表</option>
											<option value="">NT / 123456789</option> -->
										</select>
									</div>
									<div class="col-md-1">金额<span class="required"></span></div>
									<div class="col-md-4"><input type="number" class="form-control text-right" id="transferPrice_"></div>
								</div>
								<div class="row" style="padding: 0.1em">
									<div class="col-md-1">流水号<span class="required"></span></div>
									<div class="col-md-4"><input type="text" class="form-control" placeholder="在付款登记中，流水号是必需的" id="transferNo_"></div>
									<div class="col-md-1">扫描</div>
									<div class="col-md-4">
										<div class="input-group">
											<input type="text" class="form-control" id="transferScan_url_" placeholder="扫描文件小于2MB,格式为.JPG/.JPGE/.PNG/.GIF" id="scan_url_">
											<div class="input-group-btn">
												<button class="btn btn-default">
													<span class="fa fa-cloud-upload-alt"></span> 上传
												</button>
											</div>
										</div>
									</div>
									<input type="hidden" id="transfereditKey_" value="-1">
									<div class="col-md-2 text-right">
										<button class="btn btn-primary" style="width:10em" @click="setTransferData(-1)"><span class="fa fa-plus"> 确定</span></button>
									</div>
								</div>

								<div class="row">
									<div class="col-md-12">
										<table class="table ntTable">
											<thead>
												<tr>
													<th>No.</th>
													<th>付款账号</th>
													<th>存款日期</th>
													<th>存入账号</th>
													<th>金额</th>
													<th>流水号</th>
													<th>扫描</th>
													<th>操作</th>
												</tr>
											</thead>
											<tbody>
												<template v-if="payerytransferData_ != undefined && payerytransferData_.length > 0">
													<tr v-for="(_payerytransferData,payerytransferDataIndex) in payerytransferData_">
														<td align="center">{{_payerytransferData.viewid}}</td>
														<td>{{_payerytransferData.transferOutName}}</td>
														<td>{{_payerytransferData.transferDay}}</td>
														<td>{{_payerytransferData.transferInName}}</td>
														<td align="right">{{formatUnit(_payerytransferData.transferPrice,'BRL')}}<small class="unit">BRL</small></td>
														<td>{{_payerytransferData.transferNo}}</td>
														<td v-if="_payerytransferData.transferscan_url">
															<button class="btn btn-sm btn-default">查看</button>
														</td>
														<td>-</td>
														<td align="right">
															<button class="btn btn-sm btn-primary" @click="payeryClickEdit(payerytransferDataIndex,'payerytransferData_')">编辑</button>
															<button class="btn btn-sm btn-default" @click="modalEditAndDel(payerytransferDataIndex,'del','payerytransferData_')">删除</button>
														</td>
													</tr>	
												</template>
												<template v-else>
						                            <tr style="text-align: center;" >
						                                <td colspan="8" class="no_date" style="line-height: 10rem">{:lang('no_data')} </td>
						                            </tr>
												</template>
											</tbody>
											<tfoot>
												<tr>
													<td colspan="7" align="right">合计：{{formatUnit(transferPriceSum[publicInfo.key],'BRL')}}<small class="unit">BRL</small></td>
													<td colspan="2">&nbsp;</td>
												</tr>
											</tfoot>
										</table>
									</div>
								</div>
							</div>

						</div>

					</div>
				</div>

			</div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal"><span class="glyphicon glyphicon-remove"></span>取消</button>
                <button type="button" class="btn btn-primary" data-dismiss="modal" style="padding-left:24px;padding-right:24px"  @click="_savePayery(-1)"><span class="glyphicon glyphicon-floppy-disk" ></span>保存</button>
            </div>
        </div>
    </div>
</div>

<!-- 快捷付款登记备注 弹窗部分-->
<div class="modal fade" id="payreg_remark_Modal" tabindex="-1" role="dialog" aria-labelledby="ntModalLabel7" aria-hidden="true">
    <div class="modal-dialog modal-lg" style="width:60%">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                <h4 class="modal-title" id="ntModalLabel7">订单({{publicInfo.saleOrderNo == '-' ? publicInfo.saleOrderNo : formatUnit(publicInfo.saleOrderNo,'id')}})快捷付款登记备注</h4>
            </div>
            <div class="modal-body">
                <div class="row">
                    <div class="col-md-12">
                        <div class="alert alert-dismissable alert-info">
                            <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
                            <p></p>
                        </div>
                    </div>
                </div>
				<div class="panel panel-info">
					<div class="row" style="padding:1em">
						<div class="col-md-2">
							<small>订单</small><br>
							{{publicInfo.saleOrderNo == '-' ? publicInfo.saleOrderNo : formatUnit(publicInfo.saleOrderNo,'id')}}
						</div>
						<div class="col-md-6">
							<small>客户</small><br>
							{{publicInfo.companyId + (publicInfo.companyName ? ' / '+publicInfo.companyName:'') }}
						</div>
						<div class="col-md-4">
							<small>付款安排</small><br>
							{{publicInfo.paymentName + (publicInfo.paymentCreate_at ? ' / '+publicInfo.paymentCreate_at:'') + (publicInfo.paymentAmount ? ' / '+ formatUnit(publicInfo.paymentAmount,'BRL'):'' ) }} <small class="unit">BRL</small>
						</div>
					</div>
				</div>

				<div class="row">
                    <div class="col-md-2">
						备注内容<span class="required"></span>
					</div>
					<div class="col-md-10">
						<div class="input-group">
							<input type="text" class="form-control" value="" id="payregRemarksContent">
							<div class="input-group-btn">
								<button class="btn btn-primary" @click="setPayregRemarksList()"><span class="fa fa-save"></span> 添加</button>
							</div>
						</div>
					</div>
				</div>
				<div class="row">
                    <div class="col-md-12">
                        <table class="table table-hover ntTable">
							<thead>
								<tr>
									<td>No.</td>
									<td style="min-width: 30vw">内容</td>
									<td>编辑</td>
									<td>操作</td>
								</tr>
							</thead>
                            <tbody>
								<tr v-for="(payregRemarkListItem,payregRemarkListIndex) in payregRemarkList">
									<td align="center">{{payregRemarkListIndex+1}}</td>
									<td>{{payregRemarkListItem.content}}</td>
									<td>{{ (payregRemarkListItem.create_name ? payregRemarkListItem.create_name + ' / ': '') + payregRemarkListItem.create_at}}</td>
									<td align="right">
										<button class="btn btn-sm btn-primary">编辑</button>
										<button class="btn btn-sm btn-default">删除</button>
									</td>
								</tr>
							</tbody>
                        </table>
                    </div>
                </div>
			</div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal"><span class="glyphicon glyphicon-remove"></span>关闭</button>
                <button type="button" class="btn btn-primary" data-dismiss="modal" style="padding-left:24px;padding-right:24px" @click="savePayregRemarks(publicInfo.key)"><span class="glyphicon glyphicon-floppy-disk"></span>保存</button>
            </div>
        </div>
    </div>
</div>

<!-- 订单付款详情 弹窗部分-->
<div class="modal fade" id="pay_info_Modal" tabindex="-1" role="dialog" aria-labelledby="ntModalLabel6" aria-hidden="true">
    <div class="modal-dialog modal-lg" style="width:70%">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                <h4 class="modal-title" id="ntModalLabel6">订单({{publicInfo.saleOrderNo == '-' ? publicInfo.saleOrderNo : formatUnit(publicInfo.saleOrderNo,'id')}})付款详情</h4>
            </div>
            <div class="modal-body">
                <div class="row">
                    <div class="col-md-12">
                        <div class="alert alert-dismissable alert-info">
                            <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
                            <p></p>
                        </div>
                    </div>
                </div>
				<div class="panel panel-info">
					<div class="row" style="padding:1em">
						<div class="col-md-2">
							<small>订单</small><br>
							{{publicInfo.saleOrderNo == '-' ? publicInfo.saleOrderNo : formatUnit(publicInfo.saleOrderNo,'id')}}
						</div>
						<div class="col-md-6">
							<small>客户</small><br>
							8888 / 巴西华为电子有限公司
						</div>
						<div class="col-md-4">
							<small>付款安排</small><br>
							期账 / 25-12-2019 / 5000.00 <small class="unit">BRL</small>
						</div>
					</div>
				</div>
				<div class="row">
					<div class="col-md-12">
						<ul class="nav nav-tabs">
							<li class="active">
								<a href="#payreg_info_cash" data-toggle="tab">现金</a>
							</li>
							<li>
								<a href="#payreg_info_voucher" data-toggle="tab">代金券</a>
							</li>
							<li>
								<a href="#payreg_info_cheque" data-toggle="tab">
									现金支票 / 期票
								</a>
							</li>
							<li>
								<a href="#payreg_info_transfer" data-toggle="tab">
									转账
								</a>
							</li>
							<li>
								<a href="#payreg_info_payout" data-toggle="tab">
									期账
								</a>
							</li>
						</ul>
					</div>
				</div>
				<div class="row" style="padding: 1em">
					<div class="col-md-12">
						<div class="tab-content">

							<!-- 现金 付款登记 -->

							<div class="tab-pane active" id="payreg_info_cash">
								<div class="row">
									<div class="col-md-12">
										<table class="table ntTable">
											<thead>
												<tr>
													<th>ID</th>
													<th>登记</th>
													<th>金额</th>
													<th>确认</th>
													<th>状态</th>
													<th>已付</th>
													<th>编辑</th>
												</tr>
											</thead>
											<tbody>
												<tr>
													<td>8888</td>
													<td>PAULO <br><small>25-11-2019 11:50:22</small></td>
													<td align="right">5000.00 <br><small class="unit">BRL</small> </td>
													<td>MARY <br><small>25-11-2019 15:40:30</small></td>
													<td><span class="text-success">成功</span></td>
													<td align="right">5000.00 <br><small class="unit">BRL</small></td>
													<td>
														MARY <br><small>25-11-2019 15:40:30</small>
													</td>
												</tr>
											</tbody>
											<tfoot>
												<tr>
													<td align="right" colspan="6">SUM(payreg.success_at &gt; 0:paid) = 合计：8888.00 <small class="unit">BRL</small></td>
													<td>&nbsp;</td>
												</tr>
											</tfoot>
										</table>
									</div>
								</div>
							</div>

							<!-- 代金券 付款登记 -->

							<div class="tab-pane" id="payreg_info_voucher">
								<div class="row">
									<div class="col-md-12">
										<table class="table ntTable">
											<thead>
												<tr>
													<th>ID</th>
													<th>登记</th>
													<th>代金券</th>
													<th>金额</th>
													<th>编辑</th>
												</tr>
											</thead>
											<tbody>
												<tr>
													<td>8888</td>
													<th>PAULO <br><small>25-11-2019 11:50:22</small></th>
													<td>2222</td>
													<td align="right">5000.00 <br><small class="unit">BRL</small> </td>
													<td>
														PAULO <br><small>25-11-2019 11:50:22</small>
													</td>
												</tr>
											</tbody>
											<tfoot>
												<tr>
													<td align="right" colspan="4">SUM(voucher:amount) = 合计：8888.00 <small class="unit">BRL</small></td>
													<td>&nbsp;</td>
												</tr>
											</tfoot>
										</table>
									</div>
								</div>
							</div>


							<!-- 支票 付款登记 -->

							<div class="tab-pane" id="payreg_info_cheque">
								<div class="row">
									<div class="col-md-12">
										<table class="table ntTable">
											<thead>
												<tr>
													<th>ID</th>
													<th>登记</th>
													<th>支票</th>
													<th>&nbsp;</th>
													<th>金额</th>
													<th>签收/确认</th>
													<th>状态</th>
													<th>存款</th>
													<th>编辑</th>
												</tr>
											</thead>
											<tbody>
												<tr>
													<td>8888</td>
													<td>PAULO <br><small>25-11-2019 11:50:22</small></td>
													<td>
														巴西中央银行<br>
														8888 8888 ABCD<br>
														TRUMP<br>
														19-01-2020<br>
													</td>
													<td>
														<button class="btn btn-sm btn-default">扫描</button>
													</td>
													<td align="right">2000.00 <br><small class="unit">BRL</small></td>
													<td>&nbsp;</td>
													<td>未确认</td>
													<td>&nbsp;</td>
													<td>
														PAULO <br><small>25-11-2019 11:50:22</small>
													</td>
												</tr>
											</tbody>
											<tfoot>
												<tr>
													<td colspan="8" align="right">SUM(pay_cheque.success_at &gt; 0:amount)合计：8000.00 <small class="unit">BRL</small></td>
													<td>&nbsp;</td>
												</tr>
											</tfoot>
										</table>
									</div>
								</div>
							</div>

							<!-- 转账 付款登记 -->

							<div class="tab-pane" id="payreg_info_transfer">
								<div class="row">
									<div class="col-md-12">
										<table class="table ntTable">
											<thead>
												<tr>
													<th>No.</th>
													<th>登记</th>
													<th>付款账号</th>
													<th>水单</th>
													<th>&nbsp;</th>
													<th>金额</th>
													<th>确认</th>
													<th>状态</th>
													<th>编辑</th>
												</tr>
											</thead>
											<tbody>
												<tr>
													<td>8888</td>
													<td>PAULO <br><small>25-11-2019 11:50:22</small></td>
													<td>
														巴西中央银行<br>
														华为（RIO）电子有限公司<br>
														**** **** **** 7890
													</td>
													<td>
														8888 7777 6666<br>
														25-02-2020<br>
														NT 888 888 ABC<br>
													</td>
													<td>
														<button class="btn btn-sm btn-default">扫描</button>
													</td>
													<td align="right">2000.00 <br><small class="unit">BRL</small></td>
													<td>
														MARY <br><small>25-11-2019 15:40:30 </small>
													</td>
													<td><span class="text-success">成功</span></td>
													<td>
														MARY <br><small>25-11-2019 15:40:30</small>
													</td>
												</tr>
											</tbody>
											<tfoot>
												<tr>
													<td colspan="8" align="right">合计：</td>
													<td colspan="2">8000.00 <small class="unit">BRL</small></td>
												</tr>
											</tfoot>
										</table>
									</div>
								</div>
							</div>

							<!-- 期账 付款登记 -->
							<div class="tab-pane" id="payreg_info_payout">
								<div class="row">
									<div class="col-md-12">
										<table class="table ntTable">
											<thead>
												<tr>
													<th>No.</th>
													<th>登记</th>
													<th>支款方式</th>
													<th>详情</th>
													<th>付款日期</th>
													<th>金额</th>
													<th>确认</th>
													<th>状态</th>
													<th>编辑</th>
												</tr>
											</thead>
											<tbody>
												<tr>
													<td>8888</td>
													<td>PAULO <br><small>25-11-2019 11:50:22</small></td>
													<td>现金</td>
													<td>
														<button class="btn btn-sm btn-default">详情</button>
													</td>
													<td>25-11-2019</td>
													<td align="right">2000.00 <br><small class="unit">BRL</small></td>
													<td>
														MARY <br><small>25-11-2019 15:40:30 </small>
													</td>
													<td><span class="text-success">成功</span></td>
													<td>
														MARY <br><small>25-11-2019 15:40:30</small>
													</td>
												</tr>
											</tbody>
											<tfoot>
												<tr>
													<td colspan="8" align="right">合计：</td>
													<td colspan="2">8000.00 <small class="unit">BRL</small></td>
												</tr>
											</tfoot>
										</table>
									</div>
								</div>
							</div>

						</div>

					</div>
				</div>
				<div class="row" style="padding:0 1em">
					<div class="col-md-12">
						<table class="table ntTable">
							<thead>
								<tr>
									<th>No.</th>
									<th width="60%">备注内容</th>
									<th>编辑</th>
								</tr>
							</thead>
							<tbody>
								<tr>
									<td align="center">1</td>
									<td>余额元旦后安排。</td>
									<td>PAULO / 19-02-2020</td>
								</tr>
							</tbody>

						</table>
					</div>
				</div>

			</div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal"><span class="glyphicon glyphicon-remove"></span>关闭</button>
            </div>
        </div>
    </div>
</div>

<!-- 送货单 -->
<div class="modal fade" id="delivery_detailModal" tabindex="-1" role="dialog" aria-hidden="true">
    <div class="modal-dialog modal-lg" style="width:70vw">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                <h4 class="modal-title">送货单详情</h4>
            </div>
            <div class="modal-body">
				<div class="row">
					<div class="col-md-4">
						<div class="panel panel-default">
							<table class="table">
								<tbody>
									<tr>
										<td>销售单</td>
										<td>
											{{ formatUnit(deliveryNoteDetailData.sale_id,'id') }}
											<span class="label label-primary pull-right">{{deliveryNoteDetailData.priority}}</span>
										</td>
									</tr>
									<tr>
										<td>送货类型</td>
										<td>{{deliveryNoteDetailData.delivery_type_name}}</td>
									</tr>
									<tr>
										<td>发票类型</td>
										<td>{{deliveryNoteDetailData.sale_invoice_code}}</td>
									</tr>
									<tr>
										<td>送货单</td>
										<td>
											{{formatUnit(deliveryNoteDetailData.id,'id')}}
											<span class="label label-primary pull-right">{{deliveryNoteDetailData.priority}}</span>
										</td>
									</tr>
									<tr>
										<td>状态</td>
										<td>配货中...</td>
									</tr>
									<tr>
										<td>创建</td>
										<td>{{deliveryNoteDetailData.create_name + (deliveryNoteDetailData.create_time ? ' / ' + deliveryNoteDetailData.create_time : '')}}</td>
									</tr>
									<tr>
										<td>编辑</td>
										<td>{{deliveryNoteDetailData.update_name + (deliveryNoteDetailData.update_time ? ' / ' + deliveryNoteDetailData.update_time : '')}}</td>
									</tr>
									<tr>
										<td>备注</td>
										<td>{{deliveryNoteDetailData.remark}}</td>
									</tr>
								</tbody>
							</table>
						</div>
					</div>
					<div class="col-md-8">
						<ul class="nav nav-tabs" style="margin-bottom: 0.5rem">
							<li class="active"><a href="#detail" data-toggle="tab">送货内容</a></li>
							<li><a href="#pack" data-toggle="tab">装箱单</a></li>
							<li><a href="#make" data-toggle="tab">配货/送货</a></li>
						</ul>
						<div class="row" >
							<div class="col-md-12 div-scroll tab-content" style="max-height: 60vh">
							
								<div class="panel panel-default tab-pane active" id="detail" >
									<table class="table table-hover">
										<thead>
											<tr>
												<th>No.</th>
												<th>产品</th>
												<th>箱规</th>
												<th>数量</th>
												<th>备注</th>
											</tr>
										</thead>
										<tbody>
											<template  v-if="deliveryNoteDetailData.detail != undefined && deliveryNoteDetailData.detail.length > 0">
												<tr v-for="(detailItem,detailIndex) in deliveryNoteDetailData.detail">
													<td align="center">{{ detailIndex+1 }}</td>
													<td>
														<div class="pro">
															<div class="pro-icon">
																<img :src="detailItem.proInfo.img_url" border="0" width="48px" height="48px">
															</div>
															<div class="pro-name">
																<small>{{ formatUnit(detailItem.proInfo.prochar_id,'id') + (detailItem.proInfo.brand_name ? ' / ' + detailItem.proInfo.brand_name : '') + (detailItem.proInfo.model ? ' / ' + detailItem.proInfo.model : '') }}</small> <br />{{detailItem.proInfo.pro_name}}
															</div>
														</div>
													</td>
													<td align="right">
														{{formatUnit(detailItem.proInfo.prochar_qty,'PCS')}}<small class="unit">PCS/CTN</small><br>
														{{detailItem.proInfo.ctn_size}}<small class="unit">CM</small>
													</td>
													<td align="right">{{ formatUnit( detailItem.qty,'PCS') }}<small class="unit">PCS</small></td>
													<td align="right">
														<button class="btn btn-sm btn-default" data-toggle="popover" title="送货备注"  @mouseover="setpopper">
															备注
															<div class="content" style="display: none;">
																<div style="width:30vw">
																	{{detailItem.remark}}
																</div>
															</div>
														</button>
													</td>
												</tr>
											</template>
											<template v-else>
												<tr style="text-align: center;">
					                                <td colspan="5" class="no_date" style="line-height: 20rem">{:lang('no_data')} </td>
					                            </tr>	
											</template>
											
										</tbody>
									</table>
								</div>
								<!-- 装箱单 -->
								<div class="panel panel-default tab-pane" id="pack">
									<table class="table table-hover table-striped">
										<thead>
											<tr>
												<th>箱号</th>
												<th>箱数</th>
												<th>产品</th>
												<th>箱规</th>
												<th>数量</th>
												<th>体积</th>
												<th>重量</th>
												<th>编辑</th>
											</tr>
										</thead>
										<tbody>
											<template v-if="deliveryNoteDetailData.salePackData != undefined && deliveryNoteDetailData.salePackData.length > 0">
											<template v-for="(salePackDataItem,salePackDataIndex) in deliveryNoteDetailData.salePackData">
												<tr v-for="(dataItem,dataIndex) in salePackDataItem.data">
													<template v-if="dataIndex == 0">
														<td align="center">{{dataIndex+1}}</td>
														<td align="right">{{salePackDataItem.ctns}}<small class="unit">CTN</small></td>	
													</template>
													<template v-else>
														<td></td>
														<td></td>
													</template>
													<td>
														<div class="pro">
															<div class="pro-icon"><img :src="dataItem.img_url" border="0" width="48px" height="48px" alt="ICON"></div>
															<div class="pro-name">
																<small>{{formatUnit(dataItem.prochar_id,'id') + (dataItem.brand_name ? ' / ' + dataItem.brand_name : '') + (dataItem.model ? ' / ' + dataItem.model :'') }}</small><br>
																{{dataItem.pro_name}}
															</div>
														</div>
													</td>
													<td align="right">
														{{dataItem.prochar_qty}}<small class="unit">PCS/CTN</small><br>
														{{dataItem.ctn_size}}<small class="unit">CM</small>
													</td>
													<td align="right">{{dataItem.qty}}<small class="unit">PCS</small></td>
													<template v-if="dataIndex == 0">
														<td align="right">{{salePackDataItem.volume*salePackDataItem.ctns}}<small class="unit">CBM</small></td>
														<td align="right">{{salePackDataItem.kgs*salePackDataItem.ctns}}<small class="unit">KGS</small></td>
														<td>{{salePackDataItem.updatename}}<br>{{salePackDataItem.update_date}}</td>
													</template>
													<template v-else>
														<td></td>
														<td></td>
														<td></td>
													</template>
												</tr>	
											</template>
											</template>
											<template v-else>
												<tr style="text-align: center;" >
					                                <td colspan="8" class="no_date" style="line-height: 10rem">{:lang('no_data')} </td>
					                            </tr>
											</template>
										</tbody>
										<tfoot  v-if="deliveryNoteDetailData.salePackData != undefined && deliveryNoteDetailData.salePackData.length >0">
											<tr>
												<td colspan="8" align="right">
													合计箱数: {{formatUnit(sumnum[0],'CTN')}}<small class="unit">CTN</small> /
													体积: {{formatUnit(sumnum[1],'CBM')}} <small class="unit">CBM</small> /
													重量: {{formatUnit(sumnum[2],'KGS')}}<small class="unit">KGS</small>
												</td>
											</tr>
										</tfoot>
									</table>
								</div>
								
								<div class="panel panel-default tab-pane" id="make">
									<table class="table table-hover">
										<tbody>
											<tr>
												<td>配货主管</td>
												<td>JORDAN</td>
											</tr>
											<tr>
												<td>打印</td>
												<td>1 / 20-02-2020 11:22:33</td>
											</tr>
											<tr>
												<td>对货员</td>
												<td>MIKAILANKINO / 20-02-2020 11:22:33</td>
											</tr>
											<tr>
												<td>仓管员</td>
												<td>ANLISANDA / 20-02-2020 11:22:33</td>
											</tr>
											<tr>
												<td>包装主管</td>
												<td>MANKIA / 20-02-2020 11:22:33</td>
											</tr>
											<tr>
												<td>装箱员</td>
												<td>SAMLOFU / 20-02-2020 11:22:33</td>
											</tr>
											<tr>
												<td>开票</td>
												<td>JACICKA / 20-02-2020 11:22:33</td>
											</tr>
											<tr>
												<td>银行单</td>
												<td>SEINDI / 20-02-2020 11:22:33</td>
											</tr>
											<tr>
												<td>物流主管</td>
												<td>KESILI / 20-02-2020 11:22:33</td>
											</tr>
											<tr>
												<td>送货员</td>
												<td>AA / BB / CC</td>
											</tr>
											<tr>
												<td>呼叫</td>
												<td>KESILI / 20-02-2020 11:22:33</td>
											</tr>
											<tr>
												<td>回执</td>
												<td>TIM / 20-02-2020 11:22:33</td>
											</tr>
										</tbody>
									</table>
								</div>
							</div>
						</div>
					</div>
				</div>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal"><span class="glyphicon glyphicon-remove"></span>取消</button>
            </div>
        </div>
    </div>
</div>
                
</div>
<script type="text/javascript">
	$('.loding').hide()
</script>
<!--弹窗部分 结束-->
{include file="public/foot"/}
<script src="/static/Admin/js/saleopen.js"></script>
